/* 
 * 图生图 Web 应用 - 全局样式表
 * 深色/浅色主题 | 玻璃态效果 | 响应式设计
 */

/* ==================== CSS 变量 ==================== */
/* NOTE: 「墨青雅韵」设计系统 - 低调内敛的东方水墨科技风格 */
:root {
    /* 浅色主题 - 宣纸雅韵 */
    --bg-primary: #f8f7f4;
    /* 宣纸白 */
    --bg-secondary: #ffffff;
    /* 纯净白 */
    --bg-tertiary: #efede8;
    /* 素绢 */
    --text-primary: #2c2c2c;
    /* 浓墨 */
    --text-secondary: #5a5a5a;
    /* 淡墨 */
    --text-muted: #999999;
    /* 远山灰 */
    --accent-primary: #4a6670;
    /* 墨青 - 低调内敛的主色 */
    --accent-secondary: #6b8a97;
    /* 浅墨青 */
    --accent-gradient: linear-gradient(135deg, #4a6670 0%, #5d7a85 50%, #3a5560 100%);
    --accent-glow: rgba(74, 102, 112, 0.25);
    --success: #5c8a6b;
    /* 竹青 */
    --warning: #a08050;
    /* 赭石 */
    --error: #9e5a5a;
    /* 暗朱砂 */
    --border-color: rgba(44, 44, 44, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(74, 102, 112, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(74, 102, 112, 0.12);
    /* 印章深红 - 用于特殊强调 */
    --seal-red: #8b4a4a;
    --seal-bg: rgba(139, 74, 74, 0.08);
}

[data-theme="dark"] {
    /* 深色主题 - 夜墨青韵 */
    color-scheme: dark;
    --bg-primary: #0d1117;
    /* 深夜墨 */
    --bg-secondary: #161b22;
    /* 墨色底 */
    --bg-tertiary: #21262d;
    /* 浅墨 */
    --text-primary: #e6edf3;
    /* 宣纸白 */
    --text-secondary: #8b949e;
    /* 淡墨 */
    --text-muted: #6e7681;
    /* 远山灰 */
    --accent-primary: #7aa2b0;
    /* 浅墨青 - 深色主题略亮 */
    --accent-secondary: #9ac0cc;
    /* 更浅墨青 */
    --accent-gradient: linear-gradient(135deg, #5d7a85 0%, #7aa2b0 50%, #4a6670 100%);
    --accent-glow: rgba(122, 162, 176, 0.2);
    --success: #7cb88a;
    /* 翠绿 */
    --warning: #c9a86c;
    /* 暖沙 */
    --error: #c27878;
    /* 暗红 */
    --border-color: rgba(240, 246, 252, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 40px rgba(122, 162, 176, 0.15);
    --glass-bg: rgba(22, 27, 34, 0.95);
    --glass-border: rgba(122, 162, 176, 0.15);
    --seal-red: #b06060;
    --seal-bg: rgba(176, 96, 96, 0.12);
}

/* ==================== 基础重置 ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* NOTE: 引入霞鹜文楷字体，营造东方文化气息 */
@import url('https://cdn.jsdelivr.net/npm/lxgw-wenkai-webfont@1.7.0/style.css');

body {
    font-family: 'LXGW WenKai', 'Noto Serif SC', Georgia, 'Times New Roman', serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
}

/* NOTE: 水墨晕染背景层 - 增强可见度 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    /* 水墨晕染渐变 - 使用墨青色调 */
    background:
        radial-gradient(ellipse 100% 60% at 10% 90%, rgba(74, 102, 112, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 90% 10%, rgba(74, 102, 112, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 0, 0, 0.06) 0%, transparent 60%);
}

/* 噪点纹理层 - 增强可见度 */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* 深色主题背景增强 */
[data-theme="dark"] body::before {
    background:
        radial-gradient(ellipse 100% 60% at 10% 90%, rgba(122, 162, 176, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 80% 50% at 90% 10%, rgba(122, 162, 176, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 0, 0, 0.25) 0%, transparent 60%);
}

[data-theme="dark"] body::after {
    opacity: 0.05;
}

/* ==================== 焦点状态 ==================== */
/* NOTE: 使用 focus-visible 避免点击时显示焦点环，仅键盘导航时显示 */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ==================== 动画可访问性 ==================== */
/* NOTE: 尊重用户的减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==================== 工具类 ==================== */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex {
    display: flex;
}

.gap-1 {
    gap: 0.5rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.error-text {
    color: var(--error);
    font-size: 0.875rem;
}

/* ==================== 通用组件 ==================== */

/* 容器 */
.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* 卡片 - 水墨风格 */
.card {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s ease;
    overflow: hidden;
}

/* NOTE: 悬停时的金色光晕效果 */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    z-index: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--glass-border);
}

.card:hover::before {
    opacity: 0.5;
}

.card>* {
    position: relative;
    z-index: 1;
}

/* 玻璃态卡片 - 霜玻璃效果 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    /* 添加顶部金色光边 */
    border-top: 1px solid rgba(122, 162, 176, 0.25);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

/* NOTE: 按钮光泽效果 */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-primary);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    padding: 0.75rem;
    border-radius: 12px;
}

/* 输入框 */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input::placeholder {
    color: var(--text-muted);
}

.input-error {
    border-color: var(--error);
}

.error-text {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ==================== 导航栏 ==================== */
/* NOTE: 水墨风格导航栏 - 金色光边装饰 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    /* 顶部金色光边 */
    box-shadow: inset 0 1px 0 rgba(122, 162, 176, 0.15), var(--shadow-sm);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo 样式 - 毛笔书法效果 */
.navbar-brand {
    font-size: 1.6rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 0.05em;
    position: relative;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Logo 下方装饰线 */
.navbar-brand::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-brand:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
}

.navbar-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--bg-tertiary);
    border: none;
    padding: 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* ==================== 认证页面 ==================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 2rem;
}

.auth-page::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
    animation: gradient-shift 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes gradient-shift {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-5%, 5%);
    }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-muted);
}

.auth-form .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 验证码 */
.captcha-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.captcha-group .input {
    flex: 1;
}

.captcha-img {
    height: 52px;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.captcha-img:hover {
    opacity: 0.8;
}

/* ==================== 主工作区 ==================== */
.main-content {
    padding-top: 5rem;
    padding-bottom: 2rem;
    min-height: 100vh;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    margin-top: 2rem;
}

/* 左侧：图片区域 */
.image-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.upload-zone h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 图片预览 */
.image-preview {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-tertiary);
    aspect-ratio: 16/9;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 裁剪区域 */
.crop-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

/* 右侧：控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.panel-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 比例选择器 */
.ratio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.ratio-btn {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.ratio-btn:hover {
    border-color: var(--accent-primary);
}

.ratio-btn.active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.ratio-btn .ratio-value {
    font-weight: 600;
    color: var(--text-primary);
}

.ratio-btn .ratio-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 尺寸滑动条 */
.size-slider {
    margin-top: 1rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.slider-value {
    font-weight: 600;
    color: var(--accent-primary);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.size-presets {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover,
.preset-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* 风格选择器 */
.style-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.style-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.style-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.style-card.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.style-card img {
    width: 100%;
    aspect-ratio: 1/2;
    object-fit: cover;
}

.style-card .style-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-weight: 500;
    text-align: center;
}

/* 提示词选择器 */
.prompt-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.prompt-item {
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.prompt-item:hover {
    border-color: var(--accent-primary);
}

.prompt-item.active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

/* 参数控制 */
.param-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.param-label {
    color: var(--text-secondary);
}

.param-value {
    font-weight: 600;
    color: var(--accent-primary);
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* 队列状态 */
.queue-status {
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    text-align: center;
}

.queue-status .queue-text {
    color: var(--accent-primary);
    font-weight: 500;
}

/* 进度条 */
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* ==================== 结果展示 ==================== */
.result-section {
    margin-top: 2rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.result-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    /* NOTE: 显示完整图片而非裁剪 */
    background: var(--bg-tertiary);
    /* 空白区域填充背景色 */
    cursor: pointer;
    /* 提示可点击放大 */
    transition: transform 0.2s ease;
}

.result-card img:hover {
    transform: scale(1.02);
}

.result-card-actions {
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
}

/* NOTE: 图片放大弹窗 Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 对比滑块 */
.compare-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
}

/* ==================== 管理后台 ==================== */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    padding-top: 4rem;
}

.admin-sidebar {
    background: var(--bg-secondary);
    padding: 2rem 1rem;
    border-right: 1px solid var(--border-color);
}

.admin-nav {
    list-style: none;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.admin-content {
    padding: 2rem;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
}

.data-table tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* ==================== 消息提示 ==================== */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent-primary);
    animation: toast-in 0.3s ease;
    max-width: 360px;
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--error);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== 加载状态 ==================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-card {
    background: var(--bg-secondary);
    padding: 2rem 3rem;
    border-radius: 16px;
    text-align: center;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .style-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .ratio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .style-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 动画工具类 ==================== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 工具类 ==================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}