@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-base: #09090b;
    --bg-surface: #121214;
    --bg-surface-hover: #1c1c1f;
    --border-color: #27272a;
    --border-highlight: #3f3f46;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --brand-primary: #3b82f6;
    --discord-color: #5865F2;
    --discord-hover: #4752C4;
    --radius-sm: 6px;
    --radius-md: 10px;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.navbar {
    border-bottom: 1px solid var(--border-color);
    background: rgba(9, 9, 11, 0.7);
    backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 50;
}

.nav-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 72px; display: flex; align-items: center; justify-content: space-between; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text-main); text-decoration: none; font-weight: 600; font-size: 18px; }
.brand svg { color: var(--brand-primary); }

.user-menu-wrapper { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; padding: 6px 12px; border-radius: var(--radius-md); border: 1px solid transparent; user-select: none; }
.user-chip:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--border-color); }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--border-color); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-main); border: 1px solid var(--border-highlight); }
.chevron { color: var(--text-muted); transition: transform 0.2s; }
.user-chip.active .chevron { transform: rotate(180deg); }

.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; width: 220px;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); z-index: 100;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-header { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.dropdown-name { font-weight: 600; font-size: 14px; color: var(--text-main); }
.dropdown-role { font-size: 12px; color: var(--brand-primary); font-weight: 500; }
.dropdown-divider { height: 1px; background: var(--border-color); }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px;
    background: transparent; border: none; color: var(--text-main); font-family: inherit;
    font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
}
.text-danger { color: #ef4444; }
.text-danger:hover { background: rgba(239, 68, 68, 0.08); }

h1, h2, h3, h4 { color: var(--text-main); letter-spacing: -0.03em; }

.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 1.5px; color: var(--brand-primary); margin-bottom: 8px; text-transform: uppercase; }

.badge { display: inline-block; padding: 4px 10px; background: rgba(59, 130, 246, 0.1); color: var(--brand-primary); border-radius: 999px; font-size: 12px; border: 1px solid rgba(59, 130, 246, 0.2); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer; border: none; }
.button-primary { background: var(--discord-color); color: white; }
.button-primary:hover { background: var(--discord-hover); }
.button-secondary { background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-color); }
.button-secondary:hover { background: var(--bg-surface-hover); }
.button-small { padding: 6px 12px; font-size: 13px; }

.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding: 80px 0; min-height: calc(100vh - 200px); }
.hero-content { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.1; font-weight: 700; }
.hero p { font-size: 16px; color: var(--text-muted); line-height: 1.6; max-width: 480px; }

.auth-error { margin-top: 16px; padding: 12px 16px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #fca5a5; border-radius: var(--radius-sm); font-size: 13px; }

.玻璃面板, .glass-panel { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: hidden; width: 100%; }
.panel-header { background: rgba(0, 0, 0, 0.2); padding: 12px 16px; display: flex; align-items: center; border-bottom: 1px solid var(--border-color); }
.window-controls { display: flex; gap: 6px; }
.window-controls span { width: 10px; height: 10px; border-radius: 50%; background: #3f3f46; }
.window-controls span:nth-child(1) { background: #ef4444; }
.window-controls span:nth-child(2) { background: #f59e0b; }
.window-controls span:nth-child(3) { background: #10b981; }
.window-title { margin: 0 auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); }
.panel-body { padding: 24px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6; }
.code-line { margin-bottom: 2px; }
.mt-2 { margin-top: 16px; }
.c-keyword { color: #c678dd; } .c-def { color: #e5c07b; } .c-class { color: #e5c07b; } .c-op { color: #56b6c2; } .c-func { color: #61afef; } .c-prop { color: #d19a66; } .c-string { color: #98c379; } .c-bool { color: #d19a66; }

#dashboard { padding: 60px 0; }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; }
.dashboard-title h2 { font-size: 28px; margin-bottom: 4px; }
.subcopy { color: var(--text-muted); font-size: 14px; }

.select-wrapper { display: flex; align-items: center; gap: 10px; background: var(--bg-surface); padding: 4px 4px 4px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.select-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-select { appearance: none; color: var(--text-main); font-family: inherit; font-size: 14px; cursor: pointer; border: none; background: rgba(255, 255, 255, 0.05); padding: 8px 36px 8px 12px; border-radius: 6px; }
.form-select:focus { outline: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 50px; }
.stat-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.stat-card span { color: var(--text-muted); font-size: 13px; }
.stat-value { font-size: 32px; font-weight: 600; line-height: 1; }

.table-section { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; }
.table-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-color); background: rgba(0, 0, 0, 0.2); }
.table-header h3 { font-size: 18px; }

.ticket-list { display: flex; flex-direction: column; }
.ticket-row { display: flex; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--border-color); transition: background 0.2s; }
.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: var(--bg-surface-hover); }

.ticket-id { width: 90px; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--text-muted); }
.ticket-id .hash { color: var(--border-highlight); }
.ticket-details { flex: 1; min-width: 0; }
.ticket-details .title { font-size: 14px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-details .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }

.loading-state, .empty-state { padding: 60px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--border-color); border-top-color: var(--brand-primary); border-radius: 50%; margin: 0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer { margin-top: auto; padding: 40px 0; border-top: 1px solid var(--border-color); background: var(--bg-base); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 13px; }
.lord-link { color: var(--text-main); text-decoration: none; font-weight: 500; }
.lord-link:hover { color: var(--brand-primary); }

@media (max-width: 768px) {
    .hero { grid-template-columns: 1fr; padding: 40px 0; text-align: center; }
    .hero-content { align-items: center; }
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 20px; }
    .dashboard-controls { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .ticket-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .ticket-action { width: 100%; }
    .ticket-action .button { width: 100%; }
    .footer-inner { flex-direction: column; gap: 10px; text-align: center; }
}