/* ============================================
   全局样式 - CSS变量与基础重置
   Windows 7 Aero 企业博客系统
   ============================================ */

/* --- 色彩系统 --- */
:root {
    /* Windows 经典蓝 - 避免紫色 */
    --win-blue: #2B5797;
    --win-blue-light: #4A8FD4;
    --win-blue-dark: #1E3F6F;
    --win-blue-hover: #3A72B8;

    /* 玻璃效果 */
    --glass-bg: rgba(255, 255, 255, 0.18);
    --glass-bg-light: rgba(255, 255, 255, 0.25);
    --glass-bg-dark: rgba(0, 0, 0, 0.25);
    --glass-bg-hover: rgba(255, 255, 255, 0.30);
    --border-light: rgba(255, 255, 255, 0.35);
    --border-lighter: rgba(255, 255, 255, 0.15);
    --border-glow: rgba(74, 143, 212, 0.5);

    /* 文字颜色 */
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-on-glass: #ffffff;
    --text-on-glass-muted: rgba(255, 255, 255, 0.75);

    /* 状态色 */
    --color-success: #1E8C45;
    --color-warning: #E8A317;
    --color-danger: #D4423E;
    --color-info: #2B5797;

    /* 阴影 */
    --shadow-window: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-window-light: 0 4px 16px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
    --shadow-btn: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --shadow-btn-hover: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    --shadow-btn-active: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-input-focus: 0 0 0 3px rgba(74, 143, 212, 0.3), 0 0 8px rgba(74, 143, 212, 0.2);

    /* 圆角 */
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* 过渡 */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* 布局 */
    --navbar-height: 48px;
    --sidebar-width: 240px;
    --container-max-width: 1200px;

    /* 毛玻璃模糊度 */
    --blur-standard: blur(12px);
    --blur-heavy: blur(20px);
    --blur-light: blur(8px);
}

/* --- 基础重置 --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 默认壁纸 - 极光/草原风格渐变 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: var(--bg-default, linear-gradient(135deg, #0d1b2a 0%, #1b2838 15%, #1a3a5c 30%, #2d6a8a 45%, #3a8a7a 55%, #2d7a5a 65%, #1a5a3a 80%, #0d2b1a 100%));
}

/* 覆盖层，用于增强文字可读性 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: rgba(0, 0, 0, 0.15);
}

/* --- 自定义滚动条 --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Firefox 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) rgba(0, 0, 0, 0.15);
}

/* --- 链接 --- */
a {
    color: var(--win-blue-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #6DB3F8;
    text-decoration: underline;
}

/* --- 图片 --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- 列表 --- */
ul, ol {
    list-style: none;
}

/* --- 通用容器 --- */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 文本工具类 --- */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Aero 窗口组件 --- */
.aero-window {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-standard);
    -webkit-backdrop-filter: var(--blur-standard);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-window);
    overflow: hidden;
}

/* --- Aero 按钮系统 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 18px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

/* 主按钮 - Windows 蓝渐变 */
.btn-primary {
    background: linear-gradient(180deg, #4A8FD4 0%, #2B5797 50%, #1E3F6F 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #5DA0E0 0%, #3A72B8 50%, #2B5797 100%);
    box-shadow: var(--shadow-btn-hover);
    border-color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

.btn-primary:active {
    background: linear-gradient(180deg, #1E3F6F 0%, #2B5797 50%, #4A8FD4 100%);
    box-shadow: var(--shadow-btn-active);
    transform: translateY(1px);
}

/* 次要按钮 */
.btn-secondary {
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.1) 100%);
    color: var(--text-on-glass);
    box-shadow: var(--shadow-btn);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.18) 100%);
    box-shadow: var(--shadow-btn-hover);
    text-decoration: none;
}

.btn-secondary:active {
    box-shadow: var(--shadow-btn-active);
    transform: translateY(1px);
}

/* 玻璃按钮 */
.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-light);
    -webkit-backdrop-filter: var(--blur-light);
    color: var(--text-on-glass);
}

.btn-glass:hover {
    background: var(--glass-bg-hover);
    text-decoration: none;
}

/* 危险按钮 */
.btn-danger {
    background: linear-gradient(180deg, #E85D59 0%, #D4423E 50%, #B3312D 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-btn);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #F06D69 0%, #E85D59 50%, #D4423E 100%);
    box-shadow: var(--shadow-btn-hover);
    text-decoration: none;
}

.btn-danger:active {
    box-shadow: var(--shadow-btn-active);
    transform: translateY(1px);
}

/* 成功按钮 */
.btn-success {
    background: linear-gradient(180deg, #2CA855 0%, #1E8C45 50%, #166E37 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-btn);
}

.btn-success:hover {
    background: linear-gradient(180deg, #3CB865 0%, #2CA855 50%, #1E8C45 100%);
    box-shadow: var(--shadow-btn-hover);
    text-decoration: none;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 10px 28px;
    font-size: 1rem;
}

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- 表单元素 --- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-on-glass);
    font-weight: 400;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--win-blue-light);
    box-shadow: var(--shadow-input-focus);
    background: rgba(255, 255, 255, 0.95);
}

.form-control::placeholder {
    color: #999;
}

/* 玻璃风格表单（用于暗色背景） */
.form-control-glass {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border-lighter);
    color: var(--text-on-glass);
}

.form-control-glass:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--win-blue-light);
    box-shadow: 0 0 0 2px rgba(74, 143, 212, 0.3);
}

.form-control-glass::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 下拉框 */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

/* 文本域 */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* --- 表格 --- */
.aero-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.aero-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-on-glass);
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.aero-table tbody tr {
    transition: background var(--transition-fast);
}

.aero-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.04);
}

.aero-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

.aero-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-lighter);
    color: var(--text-on-glass);
}

/* --- 消息提示 --- */
.alert {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    border: 1px solid;
}

.alert-success {
    background: rgba(30, 140, 69, 0.15);
    border-color: rgba(30, 140, 69, 0.3);
    color: #4ADE80;
}

.alert-danger {
    background: rgba(212, 66, 62, 0.15);
    border-color: rgba(212, 66, 62, 0.3);
    color: #F87171;
}

.alert-warning {
    background: rgba(232, 163, 23, 0.15);
    border-color: rgba(232, 163, 23, 0.3);
    color: #FBBF24;
}

.alert-info {
    background: rgba(43, 87, 151, 0.15);
    border-color: rgba(43, 87, 151, 0.3);
    color: #60A5FA;
}

/* --- 分页 --- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    justify-content: center;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--glass-bg);
    backdrop-filter: var(--blur-light);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-on-glass);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.page-btn:hover {
    background: var(--glass-bg-hover);
    text-decoration: none;
}

.page-btn.active {
    background: linear-gradient(180deg, rgba(74,143,212,0.5) 0%, rgba(43,87,151,0.6) 100%);
    border-color: rgba(74, 143, 212, 0.5);
    font-weight: 600;
}

.page-dots {
    padding: 6px 8px;
    color: var(--text-on-glass-muted);
}

/* --- 加载动画 --- */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--win-blue-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 响应式基础 --- */
@media (max-width: 768px) {
    :root {
        --navbar-height: 44px;
    }

    html {
        font-size: 13px;
    }

    .container {
        padding: 0 12px;
    }
}
