/* ========================================
   风屿汐 (Fengyuxi) - Shared Styles
   Auto-generated from common page patterns
   ======================================== */

:root {
    --bg-dark: #030712;
    --bg-card: #0f172a;
    --bg-card-hover: #1e293b;
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.3);
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-green: #10b981;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #1e293b;
}

body.light-theme {
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 3rem;
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.95);
}

.nav-content {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg { width: 24px; height: 24px; fill: white; }

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width 0.3s;
}

.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ===== Navigation actions / theme toggle in navbar ===== */
.theme-toggle-navbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    font-weight: 500;
}

.theme-toggle-navbar:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.theme-toggle-navbar svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

body.light-theme .theme-toggle-navbar {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .theme-toggle-navbar:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ===== User Menu ===== */
.user-menu { position: relative; }

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 200px;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.user-dropdown.active { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.dropdown-item svg { width: 18px; height: 18px; fill: currentColor; }

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px var(--accent-cyan-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-cyan-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-cyan);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-input::placeholder { color: var(--text-muted); }

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-cyan);
}

.checkbox-group a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.checkbox-group a:hover { text-decoration: underline; }

/* ===== Alert ===== */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.alert.visible { display: block; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    z-index: 300;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { border-color: var(--accent-green); }
.toast.error { border-color: var(--accent-red); }

/* ===== Loading ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 7, 18, 0.5);
    z-index: 999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

body.light-theme .loading-overlay {
    background: rgba(241, 245, 249, 0.5);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-footer .btn { flex: 1; }

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    top: 72px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-item:hover {
    background: none;
    color: var(--text-secondary);
}

.sidebar-item.active {
    background: none;
    color: var(--text-secondary);
}

.sidebar-item svg { width: 20px; height: 20px; fill: currentColor; }

/* ===== Main Content Layout ===== */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem 3rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
}

/* ===== Card ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title svg { width: 20px; height: 20px; fill: var(--accent-cyan); }

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.badge.warning {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.badge.info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

/* ===== Table ===== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== Pill ===== */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    background: var(--bg-dark);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.pill.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    fill: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 0.75rem;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.pagination button.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: white;
}

/* ===== Mobile Bottom Nav ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0.5rem 0;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(20px);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    gap: 0.2rem;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s;
    min-width: 60px;
}

.mobile-bottom-nav a svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.mobile-bottom-nav a.active {
    color: var(--accent-cyan);
}

.mobile-bottom-nav a:hover {
    color: var(--accent-cyan);
}

/* ===== Theme Toggle (sidebar) ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.theme-toggle svg { width: 20px; height: 20px; fill: currentColor; }

/* ===== Ripple Effect ===== */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== Media Queries ===== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1.5rem 1.5rem 5rem; }
    .nav-links { display: none; }
    .mobile-bottom-nav { display: flex; }
}

/* ===== Global Mobile Improvements ===== */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    .form-input {
        font-size: 16px !important;
        padding: 0.75rem 1rem !important;
    }
    .form-select {
        font-size: 16px !important;
    }
    body {
        padding-bottom: 60px;
    }
    .card {
        padding: 1.25rem;
    }
    .table-container {
        overflow-x: auto;
    }
    .table th,
    .table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
    .page-title {
        font-size: 1.5rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .navbar {
        padding: 0 1.5rem;
    }
}

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    height: 180px;
    margin-bottom: 1rem;
}
.skeleton-line {
    height: 16px;
    margin-bottom: 8px;
    width: 60%;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.long { width: 80%; }
.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}
.skeleton-avatar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

/* ===== Theme Transition ===== */
body {
    transition: background-color 0.4s ease, color 0.4s ease;
}
.card, .btn, .form-input, select, textarea, .sidebar, nav, .modal, .modal-content, .dropdown-menu {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
