/* index.css - 前台用户界面样式 */
:root {
    --c-deep: #0c0f1d;
    --c-navy: #0f172a;
    --c-indigo: #6366f1;
    --c-cyan: #06b6d4;
    --c-surface: #ffffff;
    --c-ice: #f1f5f9;
    --c-bg: #f8fafc;
    --c-text: #0f172a;
    --c-muted: #64748b;
    --c-border: #e2e8f0;
    --c-border-light: #f1f5f9;
    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md: 0 2px 8px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-lg: 0 8px 24px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.04);
    --shadow-xl: 0 16px 48px rgba(15,23,42,0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--c-bg);
    color: var(--c-text);
}

/* ===== Login ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0c0f1d 0%, #1a1f35 50%, #0f172a 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-container::before {
    content: '';
    position: absolute;
    top: -30%; left: -20%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
}
.login-container::after {
    content: '';
    position: absolute;
    bottom: -20%; right: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 70%);
}
.login-form {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 48px 40px;
    width: 380px;
    max-width: 100%;
    position: relative;
    z-index: 1;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}
.login-brand-mark {
    width: 56px;
    height: 56px;
    background: var(--gradient-brand);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.login-form h2 {
    text-align: center;
    color: #f8fafc;
    font-size: 22px;
    font-weight: 700;
    margin: 16px 0 6px;
    letter-spacing: 3px;
}
.login-subtitle {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    margin-bottom: 32px;
}
.login-password-toggle {
    cursor: pointer;
    color: #6366f1;
    font-size: 13px;
    user-select: none;
}
.login-footer {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 12px;
    margin-top: 32px;
}

/* ===== App Container ===== */
.app-container { height: 100vh; display: flex; }

/* ===== Sidebar ===== */
.sidebar {
    width: 250px;
    height: 100vh;
    background: var(--c-deep);
    position: fixed;
    left: 0; top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.04);
    transition: width 0.25s cubic-bezier(.4,0,.2,1);
}
.sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 2px; height: 100%;
    background: var(--gradient-brand);
    opacity: 0.5;
}
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .sidebar-logo h1 { display: none; }
.sidebar.collapsed .sidebar-menu .el-menu-item span { display: none; }
.sidebar.collapsed .sidebar-menu .el-menu-item { justify-content: center; padding-left: 0 !important; padding-right: 0 !important; }
.sidebar.collapsed .sidebar-menu { padding: 20px 8px; }
.sidebar.collapsed .sidebar-footer { padding: 10px 6px; }
.sidebar.collapsed .sidebar-version { font-size: 0; line-height: 0; }
.sidebar.collapsed .menu-icon { margin-right: 0; }
.sidebar.collapsed .sidebar-brand { justify-content: center; }

.sidebar-collapse-btn {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--c-deep);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    transition: background 0.2s, color 0.2s;
}
.sidebar-collapse-btn:hover { background: #1e293b; color: #a5b4fc; }
.sidebar-collapse-btn svg { transition: transform 0.25s; }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

.sidebar-logo {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.sidebar-logo h1 {
    font-size: 19px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 3px;
    white-space: nowrap;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-icon-wrap {
    width: 34px; height: 34px;
    background: var(--gradient-brand);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.brand-letter {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.sidebar-menu {
    border-right: none !important;
    background: transparent !important;
    padding: 20px 14px;
    flex: 1;
}
.sidebar-menu .el-menu-item {
    height: 44px;
    line-height: 44px;
    color: #7c8db5;
    margin: 3px 0;
    border-radius: var(--radius-sm);
    border-left: none;
    transition: color 0.2s ease, background-color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    padding-left: 16px !important;
    cursor: pointer;
    position: relative;
}
.sidebar-menu .el-menu-item:hover {
    background: rgba(255,255,255,0.05) !important;
    color: #c4ccdf;
}
.sidebar-menu .el-menu-item.is-active {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #a5b4fc !important;
    font-weight: 600;
}
.sidebar-menu .el-menu-item.is-active::before {
    content: '';
    position: absolute;
    left: 0; top: 10px; bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gradient-brand);
}

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}
.sidebar-version {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    line-height: 1.7;
}
.menu-icon {
    margin-right: 10px;
    flex-shrink: 0;
    vertical-align: middle;
    opacity: 0.7;
}
.el-menu-item:hover .menu-icon,
.el-menu-item.is-active .menu-icon { opacity: 1; }

/* ===== Main Content ===== */
.main-content {
    margin-left: 250px;
    flex: 1;
    min-height: 100vh;
    background: var(--c-bg);
    padding: 28px 36px;
    transition: margin-left 0.25s cubic-bezier(.4,0,.2,1);
}

.content-header {
    background: var(--c-surface);
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--c-border);
}
.content-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-text);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(99,102,241,0.2);
}
.user-balance {
    background: var(--gradient-brand);
    color: #fff;
    padding: 7px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

/* ===== Cards ===== */
.content-card {
    background: var(--c-surface);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(15,23,42,0.05);
    border: 1px solid var(--c-border);
    position: relative;
    overflow: hidden;
}
.card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--c-border-light);
}
.card-header-custom h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
}

/* ===== Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--c-surface);
    color: var(--c-text);
    padding: 0;
    border-radius: 12px;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
    box-shadow: 0 2px 8px rgba(15,23,42,0.05);
    border: 1px solid var(--c-border);
}
.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,0.08);
    border-color: rgba(99,102,241,0.2);
}
.stat-card-body { padding: 16px 18px 14px; }
.stat-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.stat-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid transparent;
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-tone-cyan { background: rgba(6,182,212,0.12); border-color: rgba(6,182,212,0.25); color: #0369a1; }
.stat-tone-emerald { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.25); color: #047857; }
.stat-tone-orange { background: rgba(249,115,22,0.08); border-color: rgba(249,115,22,0.22); color: #c2410c; }
.stat-tone-violet { background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.25); color: #7c3aed; }
.stat-value {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--c-text);
    line-height: 1.2;
}
.stat-label {
    font-size: 12px;
    color: var(--c-muted);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ===== Welcome Banner ===== */
.welcome-banner {
    background: var(--gradient-brand);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(99,102,241,0.2);
    position: relative;
    overflow: hidden;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -60%; left: 30%;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}
.welcome-text h3 {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    position: relative; z-index: 1;
}
.welcome-text p {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    position: relative; z-index: 1;
}
.welcome-actions {
    display: flex;
    gap: 10px;
    position: relative; z-index: 1;
}
.welcome-actions .el-button {
    background: rgba(255,255,255,0.2) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: #fff !important;
    backdrop-filter: blur(8px);
    font-weight: 600;
    box-shadow: none !important;
}
.welcome-actions .el-button:hover {
    background: rgba(255,255,255,0.3) !important;
    border-color: rgba(255,255,255,0.5) !important;
}

/* ===== Announcement ===== */
.announcement-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-left: 4px solid var(--c-indigo);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}
.announcement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.announcement-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.announcement-title-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--c-indigo);
}
.announcement-title-icon svg { width: 16px; height: 16px; stroke: #fff; }
.announcement-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
}
.announcement-subtitle {
    font-size: 11px;
    color: var(--c-muted);
    margin-top: 1px;
}
.announcement-body {
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 16px;
}
.announcement-content {
    white-space: pre-line;
    color: #334155;
    line-height: 1.7;
    font-size: 13px;
}

/* ===== Type Selector ===== */
.type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.type-option {
    background: #f8fafc;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.type-option:hover {
    border-color: #a5b4fc;
    background: #f0f2ff;
}
.type-option.is-active {
    border-color: var(--c-indigo);
    background: rgba(99,102,241,0.06);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.type-option.is-soldout {
    opacity: 0.5;
    cursor: not-allowed;
}
.type-option.is-soldout:hover {
    border-color: var(--c-border);
    background: #f8fafc;
}
.type-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.type-badge {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}
.type-check {
    width: 20px; height: 20px;
    stroke: var(--c-indigo);
}
.type-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}
.type-desc {
    font-size: 12px;
    color: #64748b;
}
.type-extra {
    font-size: 11px;
    color: #f59e0b;
    margin-top: 4px;
    font-weight: 600;
}

/* ===== SMS Panel ===== */
.sms-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.sms-panel {
    min-height: 200px;
}
.auto-phone-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.auto-phone-input { flex: 1; min-width: 180px; }
.auto-phone-btn { white-space: nowrap; }
.task-list {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    font-size: 13px;
    gap: 10px;
    transition: background 0.2s;
}
.task-item:hover { background: #f1f5f9; }
.task-success { border-left: 3px solid #10b981; }
.task-failed { border-left: 3px solid #ef4444; }
.task-pending { border-left: 3px solid #f59e0b; }
.task-info { flex: 1; min-width: 0; }
.task-type {
    font-size: 11px;
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 4px;
    display: inline-block;
    background: rgba(99,102,241,0.08);
    padding: 1px 8px;
    border-radius: 4px;
}
.task-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: #64748b;
}
.task-summary { display: flex; gap: 6px; }
.task-summary-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
}
.task-new { animation: highlight 0.8s ease; background: #eef2ff !important; }
@keyframes highlight {
    0% { background: #c7d2fe; }
    100% { background: var(--c-bg); }
}

.hint-box {
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    border-radius: 8px;
    color: #0369a1;
    font-size: 13px;
}
.empty-state { text-align: center; padding: 60px 20px; color: var(--c-muted); }

/* ===== Mobile ===== */
.mobile-menu-btn {
    display: none;
    position: fixed; top: 12px; left: 12px; z-index: 1001;
    width: 40px; height: 40px;
    background: var(--c-deep); border: none; border-radius: var(--radius-sm);
    color: #f8fafc; cursor: pointer;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.mobile-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(12,15,29,0.6); z-index: 99;
    backdrop-filter: blur(4px);
}
.mobile-overlay.show { display: block; }

@media (min-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .type-selector { grid-template-columns: repeat(3, 1fr); }
    .sms-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s cubic-bezier(.4,0,.2,1); width: 250px !important; }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar-collapse-btn { display: none; }
    .main-content { margin-left: 0 !important; padding: 16px; padding-top: 64px; }
    .content-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .content-header h2 { font-size: 16px; }
    .user-info { width: 100%; justify-content: space-between; }
    .stats-grid { grid-template-columns: 1fr; }
    .type-selector { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .welcome-banner { flex-direction: column; align-items: flex-start; gap: 16px; }
    .welcome-actions { width: 100%; }
    .welcome-actions .el-button { flex: 1; }
    .announcement-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 480px) {
    .main-content { padding: 72px 12px 16px 12px; }
    .content-card { padding: 14px; }
    .type-selector { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .type-option { padding: 8px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card-body { padding: 12px 14px 10px; }
    .stat-value { font-size: 18px; }
    .auto-phone-row { gap: 8px; }
    .auto-phone-input { flex: 1 1 100%; }
    .auto-phone-btn { flex: 1; }
    .task-item { padding: 12px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .task-info { width: 100%; }
    .user-balance { font-size: 12px; padding: 5px 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
