/* -------------------------------------------------------------
 * CLASSSYNC DESIGN SYSTEM (Vanilla CSS)
 * Curated HSL colors, premium dark theme, glassmorphism, transitions
 * ------------------------------------------------------------- */

/* Reset & Variables */
:root {
    --font-head: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Colors (HSL) */
    --color-bg: hsl(222, 47%, 7%);
    --color-panel: rgba(13, 20, 38, 0.45);
    --color-panel-border: rgba(255, 255, 255, 0.08);
    
    --color-text-primary: hsl(210, 40%, 96%);
    --color-text-secondary: hsl(215, 25%, 70%);
    --color-text-muted: hsl(215, 16%, 50%);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(263, 85%, 65%), hsl(217, 90%, 60%));
    --gradient-glow: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, rgba(59, 130, 246, 0.15) 50%, rgba(0, 0, 0, 0) 100%);
    --gradient-glow-2: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
    
    /* Interactive Colors */
    --color-primary: hsl(250, 85%, 65%);
    --color-primary-hover: hsl(250, 95%, 70%);
    --color-success: hsl(142, 70%, 45%);
    --color-danger: hsl(350, 80%, 60%);
    --color-danger-hover: hsl(350, 90%, 65%);
    --color-warning: hsl(45, 90%, 55%);
    
    /* Shadow & Glass */
    --glass-blur: blur(16px);
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15);
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition-smooth: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Form & component tokens */
    --color-input-bg: rgba(255, 255, 255, 0.04);
    --color-input-border: rgba(255, 255, 255, 0.08);
    --color-input-focus-bg: rgba(255, 255, 255, 0.07);
    --color-stat-bg: rgba(0, 0, 0, 0.15);
    --color-stat-border: rgba(255, 255, 255, 0.03);
    --color-btn-secondary-bg: rgba(255, 255, 255, 0.08);
    --color-btn-secondary-border: rgba(255, 255, 255, 0.1);
    --color-shadow-stage: rgba(0, 0, 0, 0.6);

    /* Semantic surface tokens — used for hardcoded dark-only components */
    --color-surface-sunken: rgba(0, 0, 0, 0.20);       /* tutorial-tabs, manual table bg, timeline */
    --color-surface-raised: rgba(255, 255, 255, 0.02);  /* pricing-item, timeline-node */
    --color-divider: rgba(255, 255, 255, 0.08);         /* table th/td borders, footer, section-divider */
    --color-divider-soft: rgba(255, 255, 255, 0.05);    /* subtle row separators */
    --color-divider-tab: rgba(255, 255, 255, 0.08);     /* tab header bottom border */
    --color-th-bg: rgba(255, 255, 255, 0.02);           /* table th background */
    --color-separator-text: rgba(255, 255, 255, 0.25);  /* "|" separators between links */
    --color-readonly-bg: rgba(0, 0, 0, 0.20);           /* read-only input background */
    --color-compact-bg: rgba(0, 0, 0, 0.25);            /* compact inputs & spinners */
    --color-compact-border: rgba(255, 255, 255, 0.08);  /* compact input borders */
    --color-compact-text: var(--color-text-primary);    /* compact input/spinner text */
    --color-toast-bg: rgba(13, 20, 38, 0.95);           /* toast background */
    --color-toast-border: rgba(255, 255, 255, 0.15);    /* toast default border */
    --color-card-hover-border: rgba(255, 255, 255, 0.15); /* card hover border */
    --color-tab-active-bg: rgba(255, 255, 255, 0.05);   /* active/hover tab pill */
    --color-dropdown-bg: #1e1b4b;                       /* select option background */
    --color-dropdown-arrow: white;                      /* select arrow SVG fill */
    --color-admin-select-bg: rgba(255, 255, 255, 0.04); /* admin select base bg */
    --color-btn-secondary-hover: rgba(255, 255, 255, 0.12);
}

/* ── Light theme overrides ─────────────────────────────────── */
:root[data-theme="light"] {
    --color-bg: hsl(210, 30%, 96%);
    --color-panel: rgba(255, 255, 255, 0.82);
    --color-panel-border: rgba(0, 0, 0, 0.07);
    
    --color-text-primary: hsl(222, 47%, 12%);
    --color-text-secondary: hsl(215, 25%, 32%);
    --color-text-muted: hsl(215, 18%, 52%);
    
    --gradient-primary: linear-gradient(135deg, hsl(263, 80%, 52%), hsl(220, 85%, 48%));
    --gradient-glow: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
    --gradient-glow-2: radial-gradient(circle, rgba(236, 72, 153, 0.03) 0%, rgba(139, 92, 246, 0.03) 50%, rgba(0, 0, 0, 0) 100%);
    
    --shadow-soft: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 4px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 24px rgba(124, 58, 237, 0.06);
    
    --color-input-bg: rgba(0, 0, 0, 0.03);
    --color-input-border: rgba(0, 0, 0, 0.10);
    --color-input-focus-bg: rgba(0, 0, 0, 0.04);
    --color-stat-bg: rgba(0, 0, 0, 0.025);
    --color-stat-border: rgba(0, 0, 0, 0.06);
    --color-btn-secondary-bg: rgba(0, 0, 0, 0.04);
    --color-btn-secondary-border: rgba(0, 0, 0, 0.08);
    --color-shadow-stage: rgba(15, 23, 42, 0.08);

    /* Semantic overrides for light mode */
    --color-surface-sunken: rgba(0, 0, 0, 0.025);
    --color-surface-raised: rgba(0, 0, 0, 0.015);
    --color-divider: rgba(0, 0, 0, 0.09);
    --color-divider-soft: rgba(0, 0, 0, 0.05);
    --color-divider-tab: rgba(0, 0, 0, 0.08);
    --color-th-bg: rgba(0, 0, 0, 0.02);
    --color-separator-text: rgba(0, 0, 0, 0.20);
    --color-readonly-bg: rgba(0, 0, 0, 0.04);
    --color-compact-bg: rgba(0, 0, 0, 0.04);
    --color-compact-border: rgba(0, 0, 0, 0.10);
    --color-compact-text: hsl(222, 47%, 12%);
    --color-toast-bg: rgba(255, 255, 255, 0.96);
    --color-toast-border: rgba(0, 0, 0, 0.10);
    --color-card-hover-border: rgba(0, 0, 0, 0.12);
    --color-tab-active-bg: rgba(0, 0, 0, 0.05);
    --color-dropdown-bg: #ffffff;
    --color-dropdown-arrow: hsl(222, 47%, 20%);
    --color-admin-select-bg: rgba(0, 0, 0, 0.03);
    --color-btn-secondary-hover: rgba(0, 0, 0, 0.06);
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: transparent;
}

body {
    background-color: transparent;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: clip;
    position: relative;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    z-index: -2;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}


/* Background Glowing Orbs */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
}
.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.18) 0%, rgba(59, 130, 246, 0.08) 70%);
    top: -200px;
    right: -100px;
    animation: orb-bounce 20s infinite alternate;
}
.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(139, 92, 246, 0.05) 70%);
    bottom: -150px;
    left: -150px;
    animation: orb-bounce 25s infinite alternate-reverse;
}
/* Tone orbs down in light mode */
:root[data-theme="light"] .orb-1 {
    background: radial-gradient(circle, rgba(124, 58, 237, 0.07) 0%, rgba(59, 130, 246, 0.04) 70%);
}
:root[data-theme="light"] .orb-2 {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, rgba(139, 92, 246, 0.03) 70%);
}

@keyframes orb-bounce {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.1); }
}

/* Application Layout */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    font-size: 28px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
}
.logo-text {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Glassmorphism Cards */
.card {
    background: var(--color-panel);
    border: 1px solid var(--color-panel-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    margin-bottom: 24px;
    /* Only transition border-color, avoid transitioning box-shadow to prevent backdrop-filter blending flash in Chrome */
    transition: border-color 0.3s ease;
    /* Keep GPU layer active to prevent sudden layer promotion flash on hover */
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.card:hover {
    border-color: var(--color-card-hover-border);
}

.border-danger:hover {
    border-color: rgba(239, 68, 68, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.card-header.text-center {
    display: block;
}
.card-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 22px;
}

/* Text styles */
.text-center { text-align: center; }
.section-title {
    font-family: var(--font-head);
    font-size: clamp(20px, 3.5vw, 32px);
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: -0.5px;
    white-space: nowrap;
    text-align: center;
}
.section-subtitle {
    color: var(--color-text-secondary);
    font-size: clamp(11px, 1.8vw, 15px);
    max-width: 100%;
    margin: 0 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Auth helper & OTP wrapper styles */
.otp-input-wrapper {
    display: flex;
    gap: 12px;
}
.otp-input-wrapper .form-input {
    flex-grow: 1;
}
.otp-input-wrapper .btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 16px;
    height: 48px; /* Match standard input height */
}
.auth-helper-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    font-size: 13px;
}
.auth-link {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
}
.auth-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}
.link-separator {
    color: var(--color-separator-text);
    user-select: none;
}
.card-text {
    color: var(--color-text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
}
.text-muted { color: var(--color-text-muted) !important; }
.text-danger { color: var(--color-danger) !important; }

/* Dashboard Grid Layout */
/* 始终 2fr 1fr，订阅卡片和教务绑定卡片强制并排（2:1） */

/* ── 左侧导航 + 右侧内容区布局 ── */
.dashboard-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.dashboard-nav {
    width: 170px;
    flex-shrink: 0;
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
}
.dashboard-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
    white-space: nowrap;
}
.dashboard-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-primary);
}
.dashboard-nav .nav-item.active {
    background: rgba(36, 199, 96, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}
.dashboard-content {
    flex: 1;
    min-width: 0;
}
.dashboard-group {
    margin-bottom: 32px;
    scroll-margin-top: 88px;
}
.dashboard-group:last-child {
    margin-bottom: 0;
}
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* 移动端：导航栏移至顶部 + 锁定 768px 布局宽度，由 JS zoom 等比缩放 */
@media (max-width: 768px) {
    html {
        overflow-x: clip;
    }
    body {
        min-width: 768px;
    }
    .dashboard-layout {
        flex-direction: column;
    }
    .dashboard-content {
        width: 100%;
    }
    .dashboard-nav {
        width: 100%;
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding: 8px 0;
        border-bottom: 1px solid var(--color-divider-soft);
        margin-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .dashboard-nav .nav-item {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
.span-2-md {
    grid-column: span 2;
}
.sub-link-card {
    grid-column: 1 / 2;
}
.edu-bind-card {
    grid-column: 2 / 3;
}
.dashboard-grid > .card {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}
.dashboard-grid > .sub-link-card,
.dashboard-grid > .edu-bind-card {
    margin-bottom: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input {
    width: 100%;
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition-smooth);
}
.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-input-focus-bg);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-container .form-input {
    padding-right: 46px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    user-select: none;
    z-index: 2;
}

.btn-toggle-password:hover {
    color: var(--color-text-primary);
    transform: scale(1.1);
}
.readonly-input {
    background: var(--color-readonly-bg);
    border-color: var(--color-input-border);
    color: var(--color-text-muted);
}
.form-tip {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 6px;
}

/* Email Input with suffix quick buttons */
.email-input-wrapper {
    display: flex;
    gap: 10px;
}
.email-input-wrapper .form-input {
    flex-grow: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    gap: 8px;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(124, 58, 237, 0.5);
}
.btn-secondary {
    background: var(--color-btn-secondary-bg);
    border: 1px solid var(--color-btn-secondary-border);
    color: var(--color-text-primary);
}
.btn-secondary:hover {
    background: var(--color-btn-secondary-hover);
}
.btn-tag {
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    color: var(--color-text-secondary);
    padding: 0 16px;
    font-size: 13px;
}
.btn-tag:hover {
    background: var(--color-btn-secondary-hover);
    color: var(--color-text-primary);
}
.btn-text {
    background: transparent;
    color: var(--color-text-secondary);
    text-decoration: underline;
    font-size: 14px;
    padding: 8px 12px;
}
.btn-text:hover {
    color: var(--color-text-primary);
}
.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--color-danger);
}
.btn-danger:hover {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}
.btn-block {
    width: 100%;
}

/* ── 按钮点击动效（涟漪 + 按压缩放）── */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.25) 0%, transparent 60%);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}
.btn:active::after {
    opacity: 1;
    transform: scale(1.5);
    transition: 0s;
}
.btn:active {
    transform: scale(0.95);
}
.btn-primary:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}
.btn-secondary:active {
    background: var(--color-btn-secondary-hover);
    transform: scale(0.95);
}
.btn-tag:active {
    transform: scale(0.92);
}
.btn-text:active {
    color: var(--color-primary);
    transform: scale(0.95);
}
.btn-danger:active {
    background: hsl(350, 90%, 50%);
    transform: scale(0.95);
}
.btn:disabled,
.btn:disabled:hover {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}
.btn:disabled::after {
    display: none;
}

/* 其他可点击元素的按压反馈 */
.btn-toggle-password:active,
.btn-refresh:active,
.tab-btn:active,
.segment-btn:active,
.btn-close-modal:active,
.modal-close-btn:active,
.btn-spinner-dec:active,
.btn-spinner-inc:active {
    transform: scale(0.90);
    filter: brightness(1.3);
    transition: transform 0.1s ease, filter 0.1s ease;
}
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-trial {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: hsl(217, 90%, 65%);
}
.badge-active {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-success);
}
.badge-expired {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

/* Dashboard Stat Grid */
.status-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}
.status-stat {
    background: var(--color-stat-bg);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-stat-border);
}
.stat-label {
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.stat-value {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    word-break: break-all;
}

/* ──── 邀请卡片复用链接行（紧凑单行布局）──── */
.copy-link-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.copy-link-wrapper .form-input {
    flex-grow: 1;
    min-width: 180px;
}
.copy-link-wrapper .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   订阅链接区 — 简洁并排按钮
   ══════════════════════════════════════════════════════════════ */

.sub-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.sub-actions-row .btn {
    flex: 1;
    min-width: 90px;
    white-space: nowrap;
}

/* Tutorials & Tabs */
.tutorial-tabs {
    background: var(--color-surface-sunken);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--color-divider-soft);
}
.tab-headers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--color-divider-tab);
    padding-bottom: 10px;
    margin-bottom: 12px;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}
.tab-btn.active, .tab-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-tab-active-bg);
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
    animation: fade-in 0.3s ease;
}
.steps-list {
    padding-left: 20px;
    font-size: 13px;
    color: var(--color-text-secondary);
}
.steps-list li {
    margin-bottom: 8px;
}

.tab-intro {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--color-surface-sunken);
    border-radius: var(--radius-sm);
    border-left: 3px solid #3b82f6;
}
.tab-intro code {
    font-size: 12px;
    background: rgba(59, 130, 246, 0.12);
    padding: 1px 5px;
    border-radius: 3px;
    color: #3b82f6;
}

/* Bound Credentials Indicator */
.bound-status-box {
    background: rgba(16, 185, 129, 0.03);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
}
.bound-success-indicator {
    display: flex;
    gap: 16px;
    align-items: center;
}
.indicator-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-success);
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
}
.indicator-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text-primary);
}
.indicator-text {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Pricing Grid */
.pricing-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pricing-item {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-divider-soft);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    transition: var(--transition-smooth);
}
.pricing-item.popular {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.03);
}
.badge-popular {
    font-size: 10px;
    background: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: bold;
    display: inline-block;
    flex-shrink: 0;
    white-space: nowrap;
}
.pricing-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.pricing-item-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 15px;
}
.pricing-item-price {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 16px;
    color: var(--color-text-primary);
}
.pricing-item-desc {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Danger Zone */
.danger-zone {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

/* Helpers */
.spacer-sm { height: 16px; }
.hidden { display: none !important; }
.letter-spacing-lg { letter-spacing: 6px; }

/* Toast Messages */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-toast-bg);
    border: 1px solid var(--color-toast-border);
    color: var(--color-text-primary);
    padding: 14px 28px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: var(--glass-blur);
    z-index: 1000;
    animation: slide-up 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
}
.toast-success { border-color: var(--color-success); }
.toast-error { border-color: var(--color-danger); }
#toast-message {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-primary);
}

/* Button Loaders */
.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* Announcement Carousel */
.announcement-card {
    margin-bottom: 24px;
    height: 300px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.announcement-card .card-header {
    padding: 10px 20px;
    margin-bottom: 0;
    flex-shrink: 0;
    border-bottom: 1px solid var(--color-divider-soft);
}
.announcement-card .card-body {
    flex: 1;
    min-height: 0;
}
.announcement-slide {
    display: flex;
    align-items: flex-start;
    height: 100%;
    padding: 12px 48px;
    gap: 20px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    box-sizing: border-box;
}
.announcement-slide.active {
    opacity: 1;
    z-index: 1;
}
.announcement-qr {
    flex-shrink: 0;
    height: 100%;
    max-width: 50%;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}
.announcement-qr img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
}
.announcement-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}
.announcement-text h4 {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.3;
    flex-shrink: 0;
}
.announcement-text p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0;
    white-space: pre-wrap;
    overflow-y: auto;
    flex: 1;
}
.announcement-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-panel-border);
    background: var(--color-panel);
    color: var(--color-text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    line-height: 1;
}
.announcement-nav-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--color-text-primary);
    border-color: var(--color-primary);
}
.announcement-nav-prev { left: 8px; }
.announcement-nav-next { right: 8px; }
.announcement-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: 6px;
}
.announcement-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-muted);
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.announcement-dot.active {
    opacity: 1;
    background: var(--color-primary);
}

/* ── [公告改进] 纯图满幅 banner 模式 ── */
.announcement-slide--banner {
    padding: 0;
}
.announcement-slide--banner > img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* 非 3.9:1 的图按居中裁切铺满 */
    display: block;
}
.announcement-slide--clickable {
    cursor: pointer;
}

/* 纯文模式：文字居中 */
.announcement-text--solo {
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
}

/* 正文内自动链接 */
.announcement-inline-link {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}
.announcement-inline-link:hover {
    filter: brightness(1.2);
}

/* 标题链接（有 link_url 时标题可点） */
.announcement-title-link {
    color: inherit;
    text-decoration: none;
}
.announcement-title-link:hover {
    color: var(--color-primary);
}

/* 「查看详情」按钮 */
.announcement-link-btn {
    display: inline-block;
    align-self: flex-start;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(36, 199, 96, 0.1);
    border: 1px solid rgba(36, 199, 96, 0.25);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.announcement-link-btn:hover {
    background: rgba(36, 199, 96, 0.2);
    border-color: var(--color-primary);
}
.announcement-text--solo .announcement-link-btn {
    align-self: center;
}

/* ── [多链接改进] 链接按钮排（图文/纯文模式） ── */
.announcement-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}
.announcement-text--solo .announcement-link-list {
    justify-content: center;
}

/* ── [多链接改进] 纯图满幅底部链接条 ── */
.announcement-banner-links {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 26px 48px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}
.announcement-banner-links a {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}
.announcement-banner-links a:hover {
    background: rgba(36, 199, 96, 0.4);
    border-color: var(--color-primary);
}

/* Footer style */
.app-footer {
    margin-top: 60px;
    padding: 32px 20px 24px;
    border-top: 1px solid var(--color-divider-soft);
    color: var(--color-text-muted);
    font-size: 12px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
    align-items: center;
}
.footer-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.footer-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    vertical-align: middle;
}
.footer-company {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.footer-copyright {
    font-size: 12px;
    margin: 0;
}
.footer-tagline {
    font-size: 11px;
    color: var(--color-text-muted);
    margin: 0;
}
.footer-epox-link {
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease;
}
.footer-epox-link:hover {
    opacity: 0.8;
}
.footer-epox-logo {
    width: 100px;
    height: auto;
}
.footer-epox-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    margin: 4px 0 0 0;
}
.footer-filing {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 11px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-divider-soft);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.footer-filing a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-filing a:hover {
    color: var(--color-text-secondary);
}
.footer-sep {
    color: var(--color-separator-text);
    opacity: 0.5;
}
.footer-psb-code {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Real-time input validation glow states */
.form-input.is-invalid {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35) !important;
}

.form-input.is-invalid:focus {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.5) !important;
}

.form-input.is-valid {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35) !important;
}

.form-input.is-valid:focus {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.5) !important;
}

/* Modal Overlay & Popups */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-smooth);
    position: relative;
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: var(--transition-smooth);
}
.modal-close-btn:hover {
    color: var(--color-text-primary);
    transform: scale(1.1);
}

/* Invitation Table */
.invitation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    text-align: left;
}
.invitation-table th {
    padding: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid var(--color-divider);
}
.invitation-table td {
    padding: 12px;
    color: var(--color-text-primary);
    font-size: 13px;
    border-bottom: 1px solid var(--color-divider-soft);
}
.invitation-table tr:last-child td {
    border-bottom: none;
}

/* Badges for Invitation Statuses */
.badge-pending {
    background: rgba(245, 158, 11, 0.15) !important;
    color: var(--color-warning) !important;
}
.badge-completed {
    background: rgba(16, 185, 129, 0.15) !important;
    color: var(--color-success) !important;
}
.badge-inactive {
    background: rgba(239, 68, 68, 0.12) !important;
    color: var(--color-danger) !important;
}

/* Card 5: School Time Config Styles */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (min-width: 768px) {
    .form-row-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Switch toggle button */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0 8px;
}
.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-input-border);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--color-divider-soft);
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.switch-container input:checked + .switch-slider {
    background-color: var(--color-primary);
}
.switch-container input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* Block config cards grid */
.block-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.block-card {
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.block-card-title {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 4px;
    border-bottom: 1px solid var(--color-input-border);
    padding-bottom: 6px;
}
.form-group-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.form-group-compact label {
    font-size: 12px;
    color: var(--color-text-muted);
}
.form-input-compact {
    background: var(--color-compact-bg) !important;
    border: 1px solid var(--color-compact-border) !important;
    color: var(--color-compact-text) !important;
    border-radius: var(--radius-sm) !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    width: 100px !important;
    box-sizing: border-box;
    font-family: var(--font-body) !important;
    height: 30px !important;
}
.form-input-compact:focus {
    border-color: var(--color-primary) !important;
    outline: none;
}

/* Spinner for class counts */
.spinner-wrapper {
    display: flex;
    align-items: center;
    background: var(--color-compact-bg);
    border: 1px solid var(--color-compact-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: 100px;
    height: 30px;
}
.spinner-wrapper button {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    width: 28px;
    height: 100%;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.spinner-wrapper button:hover {
    background: var(--color-tab-active-bg);
    color: var(--color-text-primary);
}
.spinner-input {
    background: transparent;
    border: none;
    color: var(--color-compact-text);
    width: 44px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}
.spinner-input::-webkit-inner-spin-button,
.spinner-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Input with suffix */
.input-suffix-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-compact-bg);
    border: 1px solid var(--color-compact-border);
    border-radius: var(--radius-sm);
    width: 100px;
    height: 30px;
}
.input-suffix-wrapper .form-input-compact {
    border: none !important;
    background: transparent !important;
    width: 70px !important;
    height: 100% !important;
}
.input-suffix-wrapper span {
    font-size: 11px;
    color: var(--color-text-muted);
    padding-right: 8px;
    user-select: none;
}

/* Manual config table */
.manual-config-box {
    margin-bottom: 24px;
}
.manual-table-scroll {
    overflow-x: auto;
    max-height: 350px;
    border: 1px solid var(--color-divider-soft);
    border-radius: var(--radius-md);
    background: var(--color-surface-sunken);
}
.manual-time-table {
    width: 100%;
    border-collapse: collapse;
}
.manual-time-table th {
    padding: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-th-bg);
    border-bottom: 1px solid var(--color-divider);
}
.manual-time-table td {
    padding: 8px 10px;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid var(--color-divider-soft);
}
.manual-time-table tr:last-child td {
    border-bottom: none;
}
.manual-time-table .form-input-compact {
    width: 90px !important;
    text-align: center;
}

/* Timeline Preview section */
.timeline-preview-section {
    background: var(--color-surface-sunken);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--color-divider-soft);
    margin-bottom: 20px;
}
.timeline-title {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}
.timeline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.timeline-node {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-divider-soft);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 95px;
    text-align: center;
}
.timeline-node.break-node {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.15);
    color: var(--color-primary);
}
.timeline-node.big-break-node {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.18);
    color: var(--color-success);
}
.timeline-node-title {
    font-weight: 600;
    color: var(--color-text-secondary);
}
.timeline-node.break-node .timeline-node-title,
.timeline-node.big-break-node .timeline-node-title {
    color: inherit;
}
.timeline-node-time {
    font-family: var(--font-head);
    font-size: 10px;
    color: var(--color-text-muted);
}

/* VIP Redemption & Admin Panel Phase 4 */
.section-divider {
    height: 1px;
    background: var(--color-divider);
    margin: 24px 0 20px 0;
}
.vip-redeem-section {
    width: 100%;
}
.redeem-title {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}
.redeem-form {
    display: flex;
    gap: 12px;
    align-items: center;
}
.redeem-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
}
.redeem-form .btn {
    padding: 10px 20px;
    font-size: 14px;
    height: 43px;
    flex-shrink: 0;
}

/* Admin Panel Design */
.admin-card {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.15) 0%, rgba(124, 58, 237, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.1) !important;
}
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
@media (min-width: 768px) {
    .admin-form-grid {
        grid-template-columns: 2fr 1fr;
    }
}
.admin-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
}
.admin-select {
    width: 100%;
    background: var(--color-admin-select-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition-smooth);
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    cursor: pointer;
    /* Arrow icon set per-theme below */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
:root[data-theme="light"] .admin-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
.admin-select:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-input-focus-bg);
}
.admin-select option {
    background-color: var(--color-dropdown-bg);
    color: var(--color-compact-text);
}
.admin-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-divider-soft);
    background: var(--color-surface-sunken);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
.admin-table th {
    padding: 12px 16px;
    color: var(--color-text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--color-divider);
    background: var(--color-th-bg);
}
.admin-table td {
    padding: 12px 16px;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-divider-soft);
}
.admin-table tr:last-child td {
    border-bottom: none;
}
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.status-badge.used {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.status-badge.unused {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.code-text {
    font-family: monospace;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: 0.5px;
}

/* =============================================================
   THEME SWITCH COMPONENT & SMOOTH TRANSITIONS
   ============================================================= */

/* Smooth Transitions for theme switching */
.form-input, 
.btn, 
.status-stat, 
.btn-theme-toggle {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================================
   COURSE SCHEDULE GRID CALENDAR VIEW
   ============================================================= */

/* Horizontal scrolling wrapper to preserve grid structure on mobile devices */
.schedule-grid-scroll {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-divider-soft);
    background: var(--color-surface-sunken);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.schedule-grid-scroll::-webkit-scrollbar {
    height: 6px;
}
.schedule-grid-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.schedule-grid-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Grid layout rules: 8 columns (1 time/section label sidebar + 7 weekdays) */
:root {
    --color-grid-bg: var(--color-surface-sunken);
    --color-grid-header-bg: rgba(255, 255, 255, 0.02);
    --color-grid-header-text: var(--color-text-secondary);
}
[data-theme="light"] {
    --color-grid-bg: var(--color-surface-sunken);
    --color-grid-header-bg: rgba(0, 0, 0, 0.03);
    --color-grid-header-text: var(--color-text-secondary);
}

.schedule-grid-container {
    display: grid;
    grid-template-columns: 80px repeat(7, minmax(110px, 1fr));
    /* grid-template-rows is set dynamically by JS based on saved configuration */
    min-width: 850px;
    position: relative;
    background: var(--color-grid-bg);
}

/* Header Cell properties (Row 1) */
.grid-header-cell {
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-grid-header-bg);
    border-right: 1px solid var(--color-divider-soft);
    border-bottom: 2px solid var(--color-divider);
    padding: 6px;
    text-align: center;
    color: var(--color-grid-header-text);
}
.grid-header-cell:last-child {
    border-right: none;
}

/* Today highlighted cell (Glassmorphic gold theme alignment) */
.grid-header-cell.is-today {
    background: rgba(234, 179, 8, 0.12) !important;
    border: 1px solid rgba(234, 179, 8, 0.3) !important;
    border-bottom: 2px solid rgba(234, 179, 8, 0.5) !important;
}
.grid-header-cell.is-today .weekday-name {
    color: #eab308 !important; /* Gold accent color */
    font-weight: 700;
}
.grid-header-cell.is-today .weekday-date {
    color: #eab308 !important;
    font-weight: 600;
    opacity: 0.9;
}

/* Top Left Time/Date corner header cell - premium translucent red */
.grid-header-cell.time-header-cell {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-primary) !important;
    background: rgba(239, 68, 68, 0.15) !important; /* Translucent coral red */
    border-right: 2px solid var(--color-divider);
    border-bottom: 2px solid var(--color-divider);
}
.grid-header-cell.time-header-cell .header-text-line {
    line-height: 1.3;
}

.weekday-name {
    font-size: 12px;
    font-weight: 600;
}
.weekday-date {
    font-size: 9.5px;
    margin-top: 2px;
    opacity: 0.8;
}

/* Sidebar Section Column (Column 1) */
.grid-section-cell {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 2px solid var(--color-divider);
    border-bottom: 1px solid var(--color-divider-soft);
    padding: 6px 2px;
    text-align: center;
    font-weight: 500;
    color: var(--color-text-primary);
}

/* Reference image section colors (glassmorphic translucent variations) */
.grid-section-cell.sec-coral {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-right-color: rgba(239, 68, 68, 0.4) !important;
}
.grid-section-cell.sec-pink {
    background-color: rgba(236, 72, 153, 0.15) !important;
    border-right-color: rgba(236, 72, 153, 0.4) !important;
}
.grid-section-cell.sec-blue {
    background-color: rgba(14, 165, 233, 0.15) !important;
    border-right-color: rgba(14, 165, 233, 0.4) !important;
}
.grid-section-cell.sec-green {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-right-color: rgba(16, 185, 129, 0.4) !important;
}
.grid-section-cell.sec-purple {
    background-color: rgba(168, 85, 247, 0.15) !important;
    border-right-color: rgba(168, 85, 247, 0.4) !important;
}

.section-number {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.section-time {
    font-family: var(--font-head);
    font-size: 9px;
    margin-top: 2px;
    line-height: 1.25;
    color: var(--color-text-muted);
}

/* Paper Grid background slot cells */
.grid-slot-cell {
    border-right: 1px solid var(--color-divider-soft);
    border-bottom: 1px solid var(--color-divider-soft);
    background: transparent;
}
.grid-slot-cell:nth-child(7n) {
    border-right: none;
}

/* Course Card overlay styling */
.grid-course-card {
    margin: 3px;
    padding: 6px;
    border-radius: 6px;
    font-size: 10.5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-left: 3px solid transparent;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
}
.grid-course-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    z-index: 5;
}

.course-name {
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 9.5px;
    color: var(--color-text-secondary);
}
.course-room, .course-teacher {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
