/* ============================================
   Minecraft 服务器管理面板 - 暗色主题 v2.0
   ============================================ */

/* ===== CSS 变量 / 主题系统 ===== */
:root {
    /* 基础色板 */
    --bg-primary: #0f0f1a;
    --bg-secondary: #16162b;
    --bg-card: #1c1c38;
    --bg-card-hover: #222244;
    --bg-input: #12122a;
    --bg-elevated: #252550;

    /* 文字 */
    --text-primary: #e8e8f0;
    --text-secondary: #9898c0;
    --text-muted: #6868a0;

    /* 主题色 - 默认翠绿 (MC) */
    --accent-h: 140;
    --accent-s: 60%;
    --accent-l: 45%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    --accent-hover: hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) + 8%));
    --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.25);
    --accent-subtle: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.12);
    --accent-border: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3);

    /* 语义色 */
    --success: #4caf50;
    --success-bg: rgba(76, 175, 80, 0.12);
    --danger: #ef5350;
    --danger-hover: #f44336;
    --danger-bg: rgba(239, 83, 80, 0.12);
    --warning: #ffa726;
    --warning-bg: rgba(255, 167, 38, 0.12);
    --info: #42a5f5;

    /* 边框 */
    --border: #2a2a50;
    --border-light: #3a3a60;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* 圆角 */
    --radius: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* 动效 */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.25s;
    --duration-slow: 0.4s;

    /* 布局 */
    --sidebar-w: 240px;
}

/* ===== 主题预设 ===== */
[data-theme="emerald"] {
    --accent-h: 140; --accent-s: 60%; --accent-l: 45%;
}
[data-theme="ocean"] {
    --accent-h: 210; --accent-s: 60%; --accent-l: 50%;
}
[data-theme="amethyst"] {
    --accent-h: 270; --accent-s: 55%; --accent-l: 50%;
}
[data-theme="nether"] {
    --accent-h: 0; --accent-s: 60%; --accent-l: 50%;
}

/* ===== 全局重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Microsoft YaHei UI', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
    transition: background var(--duration-normal);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== 粒子背景 ===== */
#particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   登录页面
   ============================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 50%, hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, hsla(270, 50%, 50%, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* 装饰网格 */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
}

/* 装饰光晕 */
.login-page::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    z-index: 0;
    animation: floatGlow 8s var(--ease-in-out) infinite alternate;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    100% { transform: translate(-40px, 40px) scale(1.2); opacity: 0.8; }
}

.login-container {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-xl);
    padding: 44px 40px 36px;
    width: 420px;
    max-width: 92%;
    box-shadow: var(--shadow-lg), 0 0 60px var(--accent-glow);
    backdrop-filter: blur(20px);
}

.login-container .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-container .logo .mc-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent), hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) - 10%)));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 14px;
    box-shadow: 0 8px 32px var(--accent-glow);
    position: relative;
    transition: transform var(--duration-slow) var(--ease-out);
}

.login-container .logo .mc-icon:hover {
    transform: scale(1.05) rotate(-5deg);
}

.login-container .logo .mc-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 23px;
    border: 1px solid var(--accent-border);
    animation: pulseRing 2s var(--ease-in-out) infinite;
}

@keyframes pulseRing {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.login-container .logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.login-container .logo p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* 登录/注册表单切换动画 */
.form-wrapper {
    position: relative;
    min-height: 340px;
}

.form-panel {
    animation: formSlideIn 0.4s var(--ease-out);
}

@keyframes formSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group .input-wrap {
    position: relative;
}

.form-group .input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--duration-normal);
}

.form-group .input-wrap input:focus + .input-icon {
    color: var(--accent);
}

.form-group input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--duration-normal) var(--ease-out);
    outline: none;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), inset 0 1px 3px rgba(0,0,0,0.3);
    background: rgba(18, 18, 42, 0.8);
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    font-family: inherit;
    text-align: center;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) - 8%)));
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 8px 32px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-hover));
    color: #fff;
    box-shadow: 0 4px 16px rgba(239, 83, 80, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 8px 32px rgba(239, 83, 80, 0.35);
    transform: translateY(-2px);
}

.btn-danger:active { transform: translateY(0); }

.btn-secondary {
    background: var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-light);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--accent-subtle);
    border-color: var(--accent-border);
    color: var(--text-primary);
}

.btn-sm {
    padding: 9px 18px;
    font-size: 13px;
    width: auto;
}

/* 验证码行 */
.verify-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.verify-row input {
    flex: 1;
    min-width: 0;
}

.verify-row .btn {
    width: auto;
    flex-shrink: 0;
    padding: 12px 16px;
    white-space: nowrap;
}

.btn-send-code {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-size: 13px;
}

.btn-send-code:hover {
    border-color: var(--accent-border);
    color: var(--accent);
}

.btn-send-code:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-muted);
}

.form-toggle {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-secondary);
}

.form-toggle a {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: color var(--duration-normal);
}

.form-toggle a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== 消息提示 ===== */
.message {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    animation: msgSlideIn 0.3s var(--ease-out);
}

@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.error {
    display: block;
    background: var(--danger-bg);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef9a9a;
}

.message.success {
    display: block;
    background: var(--success-bg);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #a5d6a7;
}

.message.info {
    display: block;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    color: var(--accent);
}

/* ============================================
   仪表盘
   ============================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #12122a 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: width var(--duration-slow) var(--ease-out);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
}

.sidebar-header .mc-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) - 10%)));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.sidebar-header .header-text h2 {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header .header-text span {
    font-size: 11px;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: var(--accent-subtle);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), hsl(var(--accent-h), var(--accent-s), calc(var(--accent-l) - 10%)));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details .user-name {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details .user-email {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all var(--duration-normal) var(--ease-out);
    width: 100%;
    justify-content: center;
}

.logout-btn:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 32px 36px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.tab-content {
    display: none;
    animation: tabFadeIn 0.4s var(--ease-out);
}

.tab-content.active {
    display: block;
}

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

.tab-header {
    margin-bottom: 28px;
}

.tab-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tab-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--duration-normal);
}

.stat-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card .stat-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 2px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== 信息行 ===== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    transition: background var(--duration-fast);
}

.info-row:hover {
    background: rgba(255,255,255,0.02);
}

.info-row:last-child { border-bottom: none; }

.info-row .info-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-row .info-value {
    font-size: 14px;
    font-weight: 500;
}

/* ===== 表单 ===== */
.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-row input, .form-row select {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--duration-normal) var(--ease-out);
    font-family: inherit;
}

.form-row input:focus, .form-row select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-row select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236868a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ===== 文件浏览器 ===== */
.file-browser {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--duration-normal);
}

.file-browser:hover {
    border-color: var(--border-light);
}

.file-browser .file-path {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-browser .file-path .path-text {
    color: var(--accent);
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 500;
}

.file-list { padding: 0; }

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    transition: all var(--duration-fast) var(--ease-out);
    font-size: 14px;
}

.file-item:last-child { border-bottom: none; }

.file-item:hover {
    background: var(--accent-subtle);
    padding-left: 24px;
}

.file-item .file-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.file-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .file-size {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

.file-item .file-date {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 16px;
    min-width: 140px;
}

.file-item.dir-item { cursor: pointer; }
.file-item.dir-item .file-icon { color: var(--warning); }

.file-empty {
    padding: 50px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== 设置页面 ===== */
.setting-group {
    margin-bottom: 24px;
}

.setting-group:last-child { margin-bottom: 0; }

.setting-group h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    transition: background var(--duration-fast);
}

.setting-item:hover {
    background: rgba(255,255,255,0.015);
}

.setting-item:last-child { border-bottom: none; }

.setting-item .setting-label {
    font-size: 14px;
    font-weight: 500;
}

.setting-item .setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 主题色预览圆点 */
.theme-dots {
    display: flex;
    gap: 10px;
}

.theme-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
}

.theme-dot:hover {
    transform: scale(1.15);
}

.theme-dot.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 12px rgba(255,255,255,0.2);
}

.theme-dot.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* 开关 */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-switch .slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 12px;
    transition: all var(--duration-normal) var(--ease-out);
}

.toggle-switch .slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out);
}

.toggle-switch input:checked + .slider {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(20px);
    background: #fff;
}

/* ===== 加载动画 ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 弹出窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    animation: overlayFadeIn 0.2s var(--ease-out);
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.show { display: flex; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 400px;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s var(--ease-out);
}

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

.modal-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal-box p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ============================================
   设置 - 卡片样式选项
   ============================================ */
.card-style-options {
    display: flex;
    gap: 10px;
}

.card-style-option {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    background: transparent;
    transition: all var(--duration-normal) var(--ease-out);
    font-family: inherit;
}

.card-style-option:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.card-style-option.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

/* 玻璃卡片样式 */
[data-card-style="glass"] .card,
[data-card-style="glass"] .stat-card,
[data-card-style="glass"] .file-browser {
    background: rgba(28, 28, 56, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* 紧凑卡片样式 */
[data-card-style="compact"] .card {
    padding: 16px;
}
[data-card-style="compact"] .card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 8px;
}
[data-card-style="compact"] .stat-card {
    padding: 16px;
}
[data-card-style="compact"] .stat-card .stat-value {
    font-size: 22px;
}
[data-card-style="compact"] .main-content {
    padding: 20px 24px;
}

/* 字体大小 */
[data-font-size="small"] { font-size: 13px; }
[data-font-size="normal"] { font-size: 14px; }
[data-font-size="large"] { font-size: 15px; }

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
    :root { --sidebar-w: 60px; }

    .sidebar-header .header-text,
    .nav-item .nav-text,
    .user-details,
    .logout-btn span {
        display: none;
    }

    .sidebar-header { padding: 16px 10px; justify-content: center; }
    .nav-item { padding: 14px 12px; justify-content: center; }
    .sidebar-footer { padding: 12px 10px; }
    .user-info { justify-content: center; margin-bottom: 6px; }
    .logout-btn { padding: 8px; }

    .main-content {
        margin-left: 60px;
        padding: 20px 16px;
    }

    .card-grid { grid-template-columns: 1fr; }
    .login-container { padding: 28px 20px; }
    .file-item .file-date { display: none; }
    .theme-dots { flex-wrap: wrap; }
}

/* ===== 减少动效 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}