/* ========================================
   梦幻西游·工具箱 — 仙侠主题基础样式
   ======================================== */

/* Google Fonts CDN 在国内加载缓慢，影响首屏性能与 SEO，已禁用。
   如需使用自定义字体，请下载至 /common/fonts/ 并用 @font-face 本地加载。
   @import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=ZCOOL+XiaoWei&display=swap');
*/

:root {
    /* 主色调 */
    --bg-deep: #0a0e14;
    --bg-primary: #0d1219;
    --bg-secondary: #131a24;
    --bg-tertiary: #1a2332;
    --bg-surface: rgba(22, 32, 46, 0.85);

    /* 金色系 */
    --gold-50: #fef9e7;
    --gold-100: #f9e8b8;
    --gold-200: #f0d48a;
    --gold-300: #e6bf5c;
    --gold-400: #d4a853;
    --gold-500: #c4943a;
    --gold-600: #a87a2a;
    --gold-700: #8c601f;
    --gold-800: #6e4a17;
    --gold-glow: rgba(212, 168, 83, 0.15);
    --gold-glow-strong: rgba(212, 168, 83, 0.35);

    /* 辅助色 */
    --cyan-accent: #4ecdc4;
    --red-accent: #e74c3c;
    --jade-green: #2ecc71;
    --ink-wash: rgba(120, 140, 160, 0.06);

    /* 文字 */
    --text-primary: #e8dcc8;
    --text-secondary: #9aa5b4;
    --text-muted: #5a6577;
    --text-gold: #d4a853;

    /* 字体 */
    --font-display: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
    --font-body: 'Noto Serif SC', 'PingFang SC', serif;

    /* 尺寸 */
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 64px;
    --navbar-height: 56px;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    /* 动效 */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-deep);
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition-normal), color var(--transition-normal);
}

a { color: var(--text-gold); text-decoration: none; }
a:hover { color: var(--gold-300); }

ul, ol { list-style: none; }

/* ---- 水墨纹理背景 ---- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 600px at 15% 20%, rgba(212, 168, 83, 0.04), transparent),
        radial-gradient(ellipse 600px 500px at 85% 75%, rgba(78, 205, 196, 0.03), transparent),
        radial-gradient(ellipse 1200px 800px at 50% 50%, rgba(22, 32, 46, 0.5), transparent);
    pointer-events: none;
    z-index: 0;
}

/* 云纹装饰 */
body::after {
    content: '';
    position: fixed;
    top: -100px;
    right: -50px;
    width: 500px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(212, 168, 83, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: cloudFloat 20s ease-in-out infinite;
}

@keyframes cloudFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    50% { transform: translate(-30px, 20px) scale(1.1); opacity: 0.8; }
}

/* ========== 布局系统 ========== */
#app {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    z-index: 1;
}

/* ---- 侧边栏 ---- */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-primary);
    border-right: 1px solid rgba(212, 168, 83, 0.08);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--gold-400) 30%,
        var(--gold-400) 70%,
        transparent
    );
    opacity: 0.2;
}

/* Logo 区域 */
.sidebar-logo {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    border-bottom: 1px solid rgba(212, 168, 83, 0.06);
    flex-shrink: 0;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.2);
}

.sidebar-logo .logo-text {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--text-gold);
    white-space: nowrap;
    letter-spacing: 2px;
}

/* 菜单 */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 3px;
}
.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 83, 0.15);
    border-radius: 3px;
}

.menu-group-title {
    padding: 16px 12px 6px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
    white-space: nowrap;
}

.menu-item:hover {
    color: var(--text-primary);
    background: var(--gold-glow);
}

.menu-item.active {
    color: var(--text-gold);
    background: var(--gold-glow);
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: linear-gradient(to bottom, var(--gold-300), var(--gold-500));
    border-radius: 0 3px 3px 0;
}

.menu-item .menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

.menu-item.active .menu-icon { opacity: 1; }

.menu-item .menu-label {
    font-size: 13px;
    transition: opacity var(--transition-fast);
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(212, 168, 83, 0.06);
    flex-shrink: 0;
}

.sidebar-footer .version-tag {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* ---- 主内容区 ---- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ---- 顶部导航栏 ---- */
.navbar {
    height: var(--navbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(212, 168, 83, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* ---- 标签栏 (Tabs) ---- */
.tab-bar {
    height: 36px;
    background: var(--bg-primary);
    border-bottom: 1px solid rgba(212, 168, 83, 0.1);
    display: flex;
    align-items: flex-end;
    padding: 0 12px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    z-index: 9;
}

.tab-bar::-webkit-scrollbar {
    height: 2px;
}

.tab-item {
    height: 30px;
    padding: 0 16px;
    min-width: 100px;
    max-width: 180px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 168, 83, 0.1);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    color: var(--text-muted);
}

.tab-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.tab-item.active {
    background: var(--bg-surface);
    color: var(--text-gold);
    border-color: rgba(212, 168, 83, 0.3);
    height: 32px;
    margin-bottom: -1px;
    z-index: 2;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--bg-surface);
}

.tab-label {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.tab-close {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.tab-close:hover {
    background: rgba(231, 76, 60, 0.2);
    color: var(--red-accent);
}

/* ---- 内容区 ---- */
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(212, 168, 83, 0.12) 20%,
        rgba(212, 168, 83, 0.12) 80%,
        transparent
    );
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-title {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb .separator {
    color: var(--text-muted);
    opacity: 0.5;
}

.breadcrumb .current {
    color: var(--text-secondary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 用户按钮 */
.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(212, 168, 83, 0.08);
    border: 1px solid rgba(212, 168, 83, 0.15);
    color: var(--text-gold);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    font-size: 13px;
}

.user-btn:hover {
    background: rgba(212, 168, 83, 0.15);
    border-color: rgba(212, 168, 83, 0.3);
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.1);
}

.user-btn .avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--bg-deep);
    font-weight: 700;
}

.user-btn .nickname {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 通知铃铛 */
.nav-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(212, 168, 83, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
    position: relative;
}

.nav-icon-btn:hover {
    background: var(--gold-glow);
    color: var(--text-gold);
    border-color: rgba(212, 168, 83, 0.2);
}

/* ---- 内容区 ---- */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    position: relative;
}

.content-area::-webkit-scrollbar {
    width: 6px;
}
.content-area::-webkit-scrollbar-track {
    background: transparent;
}
.content-area::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 83, 0.1);
    border-radius: 3px;
}
.content-area::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 168, 83, 0.2);
}

/* ========== 公共组件样式 ========== */

/* 卡片 */
.card {
    background: var(--bg-surface);
    border: 1px solid rgba(212, 168, 83, 0.06);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    backdrop-filter: blur(12px);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(212, 168, 83, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--text-gold);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: linear-gradient(to bottom, var(--gold-300), var(--gold-600));
    border-radius: 2px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    color: var(--bg-deep);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(212, 168, 83, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(212, 168, 83, 0.35);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(212, 168, 83, 0.2);
    color: var(--text-gold);
}

.btn-ghost:hover {
    background: var(--gold-glow);
    border-color: rgba(212, 168, 83, 0.35);
}

/* 页面过渡 */
.page-enter-active {
    animation: pageIn 0.4s ease-out;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分割线 - 水墨风 */
.ink-divider {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(212, 168, 83, 0.15) 20%,
        rgba(212, 168, 83, 0.15) 80%,
        transparent
    );
    margin: 16px 0;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(212, 168, 83, 0.08);
}

.data-table td {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:hover td {
    background: var(--gold-glow);
    color: var(--text-primary);
}

/* 输入框 */
.input {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(212, 168, 83, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
    width: 100%;
}

.input:focus {
    border-color: var(--gold-400);
    box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.1);
}

.input::placeholder {
    color: var(--text-muted);
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tag-gold {
    background: rgba(212, 168, 83, 0.12);
    color: var(--gold-300);
    border: 1px solid rgba(212, 168, 83, 0.2);
}

.tag-cyan {
    background: rgba(78, 205, 196, 0.1);
    color: var(--cyan-accent);
    border: 1px solid rgba(78, 205, 196, 0.2);
}

.tag-red {
    background: rgba(231, 76, 60, 0.1);
    color: var(--red-accent);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -var(--sidebar-width);
        z-index: 100;
        transition: left var(--transition-normal);
    }
    .sidebar.mobile-open {
        left: 0;
    }
}

/* ========== 白天模式 ========== */
html[data-theme="light"] {
    --bg-deep: #f5f0e8;
    --bg-primary: #ebe5d9;
    --bg-secondary: #f0ebe1;
    --bg-tertiary: #e6dfd3;
    --bg-surface: rgba(255, 252, 245, 0.9);

    --gold-glow: rgba(168, 122, 42, 0.1);
    --gold-glow-strong: rgba(168, 122, 42, 0.25);

    --text-primary: #3a2e1e;
    --text-secondary: #6b5d4d;
    --text-muted: #9e8e7a;
    --text-gold: #8c601f;

    --ink-wash: rgba(80, 60, 30, 0.04);
}

html[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 800px 600px at 15% 20%, rgba(168, 122, 42, 0.04), transparent),
        radial-gradient(ellipse 600px 500px at 85% 75%, rgba(78, 140, 130, 0.03), transparent),
        radial-gradient(ellipse 1200px 800px at 50% 50%, rgba(245, 240, 232, 0.3), transparent);
}

html[data-theme="light"] body::after {
    background: radial-gradient(ellipse, rgba(168, 122, 42, 0.04) 0%, transparent 70%);
}

html[data-theme="light"] .sidebar {
    border-right-color: rgba(168, 122, 42, 0.1);
}

html[data-theme="light"] .sidebar::after {
    background: linear-gradient(to bottom, transparent, var(--gold-600) 30%, var(--gold-600) 70%, transparent);
    opacity: 0.1;
}

html[data-theme="light"] .card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .data-table td {
    border-bottom-color: rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .user-btn .avatar {
    color: #fff;
}

/* ---- 主题切换按钮 ---- */
.theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(212, 168, 83, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--gold-glow);
    color: var(--text-gold);
    border-color: rgba(212, 168, 83, 0.25);
    transform: rotate(15deg);
}

.theme-toggle .theme-icon {
    transition: transform 0.4s ease, opacity 0.3s ease;
}

/* ---- 登录弹窗样式 ---- */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-modal {
    width: 90%;
    max-width: 380px;
    background: var(--bg-surface);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 168, 83, 0.1);
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-modal-title {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--text-gold);
    letter-spacing: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.auth-form-input {
    width: 100%;
    background: rgba(10, 14, 20, 0.6);
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: 6px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-fast);
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--text-gold);
    background: rgba(10, 14, 20, 0.8);
    box-shadow: 0 0 10px rgba(212, 168, 83, 0.15);
}

.auth-btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 4px;
    transition: all var(--transition-normal);
    margin-top: 10px;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(212, 168, 83, 0.3);
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
}

.auth-switch-mode {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
}

.auth-switch-link {
    color: var(--text-gold);
    cursor: pointer;
    font-weight: 600;
    margin-left: 4px;
}

.auth-switch-link:hover {
    text-decoration: underline;
}

.auth-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.auth-close-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-gold);
}

.user-status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}

.user-name {
    color: var(--text-gold);
    font-weight: 600;
    font-size: 14px;
}

.auth-trigger-btn {
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.auth-trigger-btn:hover {
    color: var(--text-gold);
}
