/* ============================================================
   服装进销存系统 - 优质CSS设计
   设计理念：玻璃态 + 精致间距 + 流畅动画 + 主题切换
   ============================================================ */

/* ====== CSS变量 - 亮色主题 ====== */
:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #e3e6ea;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --accent-rgb: 99, 102, 241;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(var(--accent-rgb), 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --sidebar-width: 240px;
    --sidebar-collapsed: 72px;
    --topbar-height: 60px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== 暗色主题 ====== */
[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-glass: rgba(26, 26, 46, 0.7);
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0b8;
    --text-muted: #6c6c80;
    --border-color: #2a2a3e;
    --accent: #818cf8;
    --accent-light: #a5b4fc;
    --accent-dark: #6366f1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(var(--accent-rgb), 0.2);
}

/* ====== 全局重置 ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ====== 顶部导航栏 ====== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    transition: all var(--transition);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.sidebar-toggle:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.brand i { font-size: 1.4rem; }

.topbar-center {
    display: flex;
    align-items: center;
}

/* 店面切换器 */
.store-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 12px;
    transition: all var(--transition);
    position: relative;
}
.store-switcher:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}
.store-switcher i { color: var(--accent); font-size: 1rem; }
.store-switcher .store-select {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    width: auto;
    cursor: pointer;
    padding: 4px 8px;
}
.store-switcher .store-select:focus { outline: none; box-shadow: none; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 主题切换器 */
.theme-switcher {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-color);
}
.theme-btn {
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    font-size: 0.95rem;
}
.theme-btn.active {
    background: var(--accent);
    color: white;
}
.theme-btn:not(.active):hover { color: var(--accent); }

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow-glow);
}
.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.user-name { font-weight: 600; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-secondary); }

.btn-logout {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.btn-logout:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ====== 侧边栏 ====== */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 90;
    transition: all var(--transition);
    overflow-y: auto;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-nav { flex: 1; padding: 16px 12px; }
.sidebar-nav ul { list-style: none; }
.nav-item { margin-bottom: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.nav-link::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform var(--transition);
}
.nav-link:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    transform: translateX(4px);
}
.nav-link.active {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.05));
    color: var(--accent);
    font-weight: 600;
}
.nav-link.active::before { transform: scaleY(1); }
.nav-link i { font-size: 1.15rem; width: 24px; text-align: center; }

.sidebar.collapsed .nav-link span { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; }

.sidebar-footer {
    padding: 12px 16px;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
}

/* ====== 主内容区 ====== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px 32px;
    min-height: calc(100vh - var(--topbar-height));
    transition: all var(--transition);
}
.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* ====== 页面标题 ====== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}
.page-title .subtitle { color: var(--text-secondary); font-size: 0.85rem; }

/* ====== 卡片 ====== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    margin-bottom: 20px;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}
.card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}
.card-body { padding: 24px; }

/* 玻璃态卡片 */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* ====== 统计卡片 ====== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    border-radius: 50%;
    opacity: 0.08;
    transform: translate(30%, -30%);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}
.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.stat-card.accent .stat-icon { background: rgba(99, 102, 241, 0.15); color: var(--accent); }
.stat-card.accent::before { background: var(--accent); }
.stat-card.success .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning .stat-icon { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.stat-card.danger::before { background: var(--danger); }

/* ====== 表格 ====== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    vertical-align: middle;
}
.data-table tbody tr {
    transition: all 0.2s ease;
}
.data-table tbody tr:hover {
    background: rgba(var(--accent-rgb), 0.04);
}
.data-table tbody tr:last-child td { border-bottom: none; }

/* 状态标签 */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-tag.active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-tag.inactive { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-tag.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-tag.verified { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-tag.rejected { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-tag.draft { background: rgba(108, 117, 125, 0.15); color: var(--text-secondary); }
.status-tag.issued { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.status-tag.void { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ====== 按钮 ====== */
.btn { border-radius: var(--radius-sm); font-weight: 500; transition: all var(--transition); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border: none;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.4);
}
.btn-action {
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 2px;
}
.btn-action:hover { background: var(--accent); color: white; border-color: var(--accent); }
.btn-action.danger:hover { background: var(--danger); border-color: var(--danger); }
.btn-action.warning:hover { background: var(--warning); border-color: var(--warning); }

/* ====== 搜索栏 ====== */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.search-bar .form-control, .search-bar .form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 14px;
    font-size: 0.88rem;
    transition: all var(--transition);
}
.search-bar .form-control:focus, .search-bar .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
.search-bar .input-group-text {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

/* ====== 模态框 ====== */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}
.modal-header .modal-title { font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}
.modal-backdrop.show { opacity: 0.5; backdrop-filter: blur(4px); }

.form-label { font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; }
.form-control, .form-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    font-size: 0.9rem;
    transition: all var(--transition);
}
.form-control:focus, .form-select:focus {
    background: var(--bg-secondary);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
    color: var(--text-primary);
}

/* ====== 分页 ====== */
.pagination {
    gap: 4px;
    margin-top: 20px;
    justify-content: center;
}
.pagination .page-link {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.85rem;
    background: var(--bg-secondary);
    transition: all var(--transition);
}
.pagination .page-link:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.pagination .active .page-link {
    background: var(--accent);
    border-color: var(--accent);
}

/* ====== 空状态 ====== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }

/* ====== Toast通知 ====== */
.toast {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.danger { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

/* ====== 选择页面 ====== */
.select-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.select-container {
    width: 100%;
    max-width: 720px;
}
.select-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    padding: 48px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
}
[data-theme="dark"] .select-card {
    background: rgba(26, 26, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}
.select-header { text-align: center; margin-bottom: 36px; }
.select-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
}
.select-header h1 {
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.select-header p { color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; }

.select-group { margin-bottom: 28px; }
.select-group > label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.store-list { display: grid; gap: 12px; }
.store-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.store-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.store-card.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}
.store-card .store-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}
.store-info h4 { color: white; font-size: 1rem; margin-bottom: 4px; }
.store-info p { color: rgba(255, 255, 255, 0.7); font-size: 0.8rem; margin: 0; }
.store-card .store-check {
    position: absolute;
    top: 16px; right: 16px;
    font-size: 1.2rem;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
}
.store-card.active .store-check { opacity: 1; }

.person-list { display: grid; gap: 12px; }
.person-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}
.person-card:hover { background: rgba(255, 255, 255, 0.15); }
.person-card.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}
.person-card .person-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}
.person-meta h4 { color: white; font-size: 0.95rem; margin: 0 0 2px; }
.person-meta p { color: rgba(255, 255, 255, 0.7); font-size: 0.8rem; margin: 0; }
.person-card .person-check {
    position: absolute;
    top: 14px; right: 14px;
    font-size: 1.1rem;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
}
.person-card.active .person-check { opacity: 1; }

.select-action { margin-top: 28px; }
.select-action .btn-primary {
    padding: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background: white;
    color: #667eea;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.select-action .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.select-footer { text-align: center; margin-top: 32px; }
.select-footer p { color: rgba(255, 255, 255, 0.5); font-size: 0.8rem; }

/* ====== 进度条/加载 ====== */
.loading-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(var(--accent-rgb), 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 库存进度条 ====== */
.stock-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}
.stock-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ====== 图表容器 ====== */
.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

/* ====== 树形结构 ====== */
.tree-list { list-style: none; padding-left: 0; }
.tree-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tree-item:hover { background: rgba(var(--accent-rgb), 0.06); }
.tree-children { list-style: none; padding-left: 24px; }

/* ====== 响应式 ====== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .topbar-center { display: none; }
    .user-meta { display: none; }
}

@media (max-width: 768px) {
    .stat-grid { grid-template-columns: 1fr; }
    .main-content { padding: 16px; }
    .search-bar { flex-direction: column; align-items: stretch; }
    .data-table { font-size: 0.8rem; }
    .data-table thead th, .data-table tbody td { padding: 8px 10px; }
}

/* ====== 动画 ====== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.pulse { animation: pulse 2s ease infinite; }

/* ====== 滚动条 ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ====== Badge ====== */
.badge {
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 4px 8px;
}

/* ====== 表单提示 ====== */
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* ====== 静态店面标签（非管理员） ====== */
.store-switcher.static {
    cursor: default;
    pointer-events: none;
}
.store-switcher.static .store-name-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    padding: 4px 8px;
}

/* ====== 登录页面 ====== */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 浮动装饰背景 */
.login-bg-shapes {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 0;
}
.login-bg-shapes .shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(2px);
    animation: floatShape 20s infinite ease-in-out;
}
.login-bg-shapes .shape-1 { width: 400px; height: 400px; top: -100px; right: -100px; animation-delay: 0s; }
.login-bg-shapes .shape-2 { width: 300px; height: 300px; bottom: -80px; left: -60px; animation-delay: 3s; }
.login-bg-shapes .shape-3 { width: 200px; height: 200px; top: 40%; left: 30%; animation-delay: 6s; background: rgba(255,255,255,0.05); }
.login-bg-shapes .shape-4 { width: 150px; height: 150px; top: 20%; right: 35%; animation-delay: 9s; background: rgba(255,255,255,0.06); }
.login-bg-shapes .shape-5 { width: 250px; height: 250px; bottom: 10%; right: 15%; animation-delay: 12s; background: rgba(255,255,255,0.04); }

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.02); }
}

.login-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 登录卡片 - 分屏布局 */
.login-card {
    width: 100%;
    max-width: 920px;
    min-height: 560px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    display: flex;
    overflow: hidden;
}
[data-theme="dark"] .login-card {
    background: rgba(26, 26, 46, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

/* 左侧品牌展示 */
.login-brand {
    flex: 0 0 42%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(118, 75, 162, 0.3));
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}
.login-brand .brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.login-brand h1 {
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 8px;
}
.login-brand .brand-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 40px;
}
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 240px;
}
.brand-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}
.brand-feature:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}
.brand-feature i { font-size: 1rem; color: rgba(255, 255, 255, 0.9); }

/* 右侧表单区 */
.login-form-wrap {
    flex: 1;
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.login-form-inner {
    width: 100%;
    max-width: 360px;
}
.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.login-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.88rem;
}

/* 主题切换 */
.login-theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.login-theme-toggle .theme-btn {
    background: none;
    border: none;
    padding: 5px 9px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
.login-theme-toggle .theme-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
.login-theme-toggle .theme-btn:hover {
    color: white;
}

/* 表单字段 */
.form-field { margin-bottom: 20px; }
.form-field .form-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.input-wrap {
    position: relative;
}
.input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.95rem;
    z-index: 2;
    pointer-events: none;
}
.input-wrap .form-control {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 14px 12px 42px;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 100%;
}
.input-wrap .form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.input-wrap .form-control:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
    outline: none;
}

/* 密码显示/隐藏按钮 */
.pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 2;
}
.pwd-toggle:hover { color: rgba(255, 255, 255, 0.8); }

/* 记住用户名 */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
}
.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

/* 登录按钮 */
.btn-login {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: white;
    color: #667eea;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.btn-login:active:not(:disabled) {
    transform: translateY(0);
}
.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.btn-loading .loading-spinner {
    width: 18px;
    height: 18px;
    border-color: rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
}

/* 测试账号提示 */
.login-hint {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.hint-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.hint-accounts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.hint-account {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.hint-account:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}
.hint-account .hint-user {
    display: block;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}
.hint-account .hint-role {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.68rem;
    margin-top: 2px;
}
.hint-note {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72rem;
    text-align: center;
}
.hint-note code {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
}

/* 登录页底部 */
.login-footer {
    text-align: center;
    margin-top: 24px;
}
.login-footer p {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.72rem;
}

/* ====== 登录页响应式 ====== */
@media (max-width: 768px) {
    .login-card {
        flex-direction: column;
        min-height: auto;
        max-width: 420px;
    }
    .login-brand {
        flex: none;
        padding: 32px 24px 20px;
    }
    .login-brand .brand-features {
        display: none;
    }
    .login-brand h1 { font-size: 1.3rem; }
    .login-form-wrap {
        padding: 32px 24px;
    }
    .hint-accounts {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

@media (max-width: 480px) {
    .login-container { padding: 0; }
    .login-card {
        border-radius: 0;
        border: none;
        min-height: 100vh;
    }
    .login-theme-toggle { top: 12px; right: 12px; }
}
