/* ═══════════════════════════════════════
   GEO Dashboard - Styles (Enhanced with Animations)
   ═══════════════════════════════════════ */

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

:root {
    --bg: #09090b;
    --surface: #18181b;
    --surface-2: #27272a;
    --border: #3f3f46;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --accent: #3b82f6;
    --accent-2: #2563eb;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --radius: 12px;
    --font: 'Space Grotesk', 'Noto Sans SC', sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ═══ ANIMATIONS ═══ */

/* Page transition */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes barFill {
    from { width: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Animation classes */
.animate-fadeIn {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.4s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.4s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-slideDown {
    animation: slideDown 0.3s ease-out forwards;
}

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ═══ LOGIN ═══ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.5s ease-out;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    animation: scaleIn 0.4s ease-out;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.login-logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.login-logo p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-form label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    display: block;
}

.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    font-family: var(--font);
    transition: all 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.login-btn:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    color: var(--danger);
    font-size: 0.75rem;
    text-align: center;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.login-error.show { display: block; }

/* ═══ APP LAYOUT ═══ */
.app {
    display: none;
    min-height: 100vh;
}

.app.active { display: flex; }

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: 200px;
    right: 0;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
    animation: slideDown 0.3s ease-out;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.topbar-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
}

.topbar-logo-text {
    font-size: 0.875rem;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--text-muted);
}

.topbar-btn.logout:hover {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    border-color: var(--danger);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s ease;
    animation: fadeInLeft 0.3s ease-out;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.sidebar-header .topbar-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sidebar-header .topbar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-header .topbar-logo-text {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-label {
    padding: 0.5rem 1.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #52525b;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text);
}

.nav-item.active {
    background: rgba(59,130,246,0.1);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

/* Main Content */
.main {
    margin-left: 200px;
    margin-top: 56px;
    padding: 1.5rem;
    min-height: calc(100vh - 56px);
    width: calc(100% - 200px);
    overflow-y: auto;
}

/* ═══ DATE NAVIGATION ═══ */
.date-nav {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.4s ease-out;
}

.date-nav-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.date-nav-scroll::-webkit-scrollbar {
    height: 4px;
}

.date-nav-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.date-nav-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.date-chip {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.625rem 1rem;
    min-width: 72px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.date-chip:hover {
    border-color: var(--text-muted);
    background: var(--surface-2);
}

.date-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 20px rgba(59,130,246,0.25);
}

.date-chip-weekday {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.date-chip.active .date-chip-weekday {
    opacity: 0.85;
}

.date-chip-day {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.date-chip-month {
    font-size: 0.625rem;
    font-weight: 500;
    opacity: 0.6;
}

.date-chip.active .date-chip-month {
    opacity: 0.8;
}

.date-chip-count {
    font-size: 0.5625rem;
    margin-top: 0.125rem;
    padding: 0.0625rem 0.375rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    font-weight: 500;
}

.date-chip.active .date-chip-count {
    background: rgba(255,255,255,0.2);
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.4s ease-out;
}

.page-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* Stats Grid */
.stats-grid,
.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
    .stats-grid, .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .stats-grid, .stats { grid-template-columns: 1fr; }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.stat-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-change {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.stat-change.up {
    color: var(--success);
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.4s ease-out;
    word-break: break-word;
    overflow-wrap: break-word;
}

.card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.card-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    font-family: var(--font);
    transition: opacity 0.2s;
}

.card-link:hover {
    opacity: 0.8;
}

.side-panel,
.ide-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.activity-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.375rem;
}

.activity-text {
    font-size: 0.8125rem;
    line-height: 1.4;
    font-family: var(--font);
}

.activity-time {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 0.625rem 1.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #52525b;
    background: rgba(255,255,255,0.02);
}

td {
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(63,63,70,0.5);
    white-space: nowrap;
}

tr:last-child td { border-bottom: none; }
tr { cursor: pointer; transition: background 0.15s; }
tr:hover td { background: rgba(255,255,255,0.03); }

.article-title {
    font-weight: 500;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 500;
    white-space: nowrap;
}

.tag-zhihu { background: rgba(0,102,255,0.15); color: #60a5fa; }
.tag-bilibili { background: rgba(251,114,153,0.15); color: #fb7299; }
.tag-jianshu { background: rgba(234,111,90,0.15); color: #ea6f5a; }
.tag-csdn { background: rgba(252,85,49,0.15); color: #fc5531; }
.tag-weixin { background: rgba(7,193,96,0.15); color: #34d399; }
.tag-baijiahao { background: rgba(33,150,243,0.15); color: #60a5fa; }
.tag-douyin { background: rgba(37,244,238,0.15); color: #25f4ee; }
.tag-xhs { background: rgba(255,36,66,0.15); color: #ff2442; }

/* Status */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.375rem;
    vertical-align: middle;
}

.status-published { background: var(--success); }
.status-draft { background: var(--warning); }

.time {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.date-cell {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Platform List */
.platform-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.platform-item + .platform-item {
    border-top: 1px solid rgba(63,63,70,0.3);
}

.platform-item:hover { background: rgba(255,255,255,0.03); }
.platform-info { display: flex; align-items: center; gap: 0.75rem; }

.platform-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.platform-name { font-size: 0.8125rem; font-weight: 500; line-height: 1.3; }

.platform-mode {
    font-size: 0.625rem;
    font-weight: 500;
    margin-top: 2px;
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    line-height: 1.5;
}

.platform-mode.mode-auto {
    background: rgba(34,197,94,0.12);
    color: var(--success);
}

.platform-mode.mode-draft {
    background: rgba(234,179,8,0.12);
    color: var(--warning);
}

.platform-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.platform-count {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--text);
}

.platform-progress {
    width: 48px;
    height: 3px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
}

.platform-progress-bar {
    height: 100%;
    border-radius: 2px;
    background: var(--success);
    transition: width 0.6s ease;
}

.platform-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

/* Settings */
.settings-section {
    padding: 0;
}

.settings-section + .settings-section {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.settings-heading {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.settings-row + .settings-row {
    border-top: 1px solid rgba(63,63,70,0.3);
}

.settings-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.settings-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    font-family: var(--mono);
}

/* Toggle Switch */
.toggle {
    width: 40px;
    height: 22px;
    background: var(--surface-2);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s;
}

.toggle.active {
    background: var(--accent);
}

.toggle.active::after {
    left: 20px;
    background: white;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.8125rem;
    font-family: var(--font);
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.form-static {
    padding: 0.625rem 0.875rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    width: 100%;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-family: var(--font);
}

.page-btn:hover { background: var(--surface-2); color: var(--text); }
.page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.modal-close:hover { color: var(--text); background: var(--surface-2); }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    z-index: 2000;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 0.8125rem;
}

.toast.show { transform: translateY(0); opacity: 1; }

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.toast-success { background: rgba(34,197,94,0.2); color: var(--success); }
.toast-error { background: rgba(248,113,113,0.2); color: var(--danger); }
.toast-warning { background: rgba(251,191,36,0.2); color: var(--warning); }

/* ═══ AI OPTIMIZER PAGE - GEO 成效监控 ═══ */

.geo-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.geo-metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.geo-metric-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.geo-metric-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.geo-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.geo-metric-percent {
    font-size: 18px;
    font-weight: 400;
}

.geo-metric-unit {
    font-size: 13px;
    color: var(--text-muted);
}

.geo-metric-highlight {
    border-left: 3px solid var(--success);
}

.geo-metric-highlight .geo-metric-value {
    color: var(--success);
}

.geo-metric-rate .geo-metric-value {
    color: var(--accent);
}

.geo-metric-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.geo-metric-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    animation: barFill 1s ease-out forwards;
}

.geo-metric-trend-up .geo-metric-value { color: var(--success); }
.geo-metric-trend-down .geo-metric-value { color: var(--danger); }
.geo-metric-trend-stable .geo-metric-value { color: var(--warning); }

.geo-trend-icon { font-size: 28px; }

.geo-section { margin-bottom: 32px; }

.geo-section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.geo-section-header h3 { font-size: 15px; font-weight: 600; }
.geo-section-sub { font-size: 12px; color: var(--text-muted); }

.geo-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.geo-platform-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s;
}

.geo-platform-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.geo-platform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.geo-platform-name { font-size: 14px; font-weight: 500; }

.geo-platform-rate {
    font-size: 16px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.geo-platform-rate.high { background: rgba(34,197,94,0.15); color: #22c55e; }
.geo-platform-rate.medium { background: rgba(234,179,8,0.15); color: #eab308; }
.geo-platform-rate.low { background: rgba(239,68,68,0.15); color: #ef4444; }

.geo-platform-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}

.geo-platform-bar-fill {
    height: 100%;
    border-radius: 3px;
    animation: barFill 1s ease-out forwards;
}

.geo-platform-bar-fill.high { background: #22c55e; }
.geo-platform-bar-fill.medium { background: #eab308; }
.geo-platform-bar-fill.low { background: #ef4444; }

.geo-platform-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.geo-mentions { display: flex; flex-direction: column; gap: 10px; }

.geo-mention-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    border-left: 3px solid var(--success);
    transition: all 0.2s;
}

.geo-mention-card:hover {
    border-color: var(--text-muted);
    transform: translateX(4px);
}

.geo-mention-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.geo-mention-platform {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border-radius: 4px;
}

.geo-mention-query { font-size: 14px; font-weight: 500; flex: 1; }
.geo-mention-time { font-size: 12px; color: var(--text-muted); }

.geo-mention-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    padding-left: 12px;
    border-left: 2px solid rgba(255,255,255,0.06);
}

.geo-empty {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* ═══ GEO HERO (AI Optimizer) ═══ */
.geo-hero {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.geo-hero-score {
    flex-shrink: 0;
    text-align: center;
    padding-right: 2rem;
    border-right: 1px solid var(--border);
    min-width: 140px;
}

.geo-hero-grade {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
}

.geo-hero-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.geo-hero-number span {
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0.5;
}

.geo-hero-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.geo-hero-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    flex: 1;
}

.geo-detail-item {
    text-align: center;
}

.geo-detail-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.geo-detail-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.stat-progress-mini {
    height: 3px;
    background: var(--surface-2);
    border-radius: 2px;
    margin-top: 0.375rem;
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.stat-grade {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.125rem;
}

/* ═══ AI PLATFORM LIST ═══ */
.ai-platform-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-platform-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--bg);
    transition: background 0.15s;
}

.ai-platform-row:hover {
    background: var(--surface-2);
}

.ai-platform-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
}

.ai-platform-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.ai-platform-name {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-platform-model {
    font-size: 0.625rem;
    color: var(--text-muted);
    font-family: var(--mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-platform-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-platform-rate-bar {
    flex: 1;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
}

.ai-platform-rate-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.ai-platform-rate-fill.rate-high { background: var(--success); }
.ai-platform-rate-fill.rate-medium { background: var(--warning); }
.ai-platform-rate-fill.rate-low { background: var(--danger); }

.ai-platform-rate-text {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 28px;
    text-align: right;
    font-family: var(--mono);
}

.ai-platform-rate-text.rate-high { color: var(--success); }
.ai-platform-rate-text.rate-medium { color: var(--warning); }
.ai-platform-rate-text.rate-low { color: var(--danger); }

.ai-platform-stats {
    display: flex;
    gap: 0.375rem;
    font-size: 0.625rem;
    color: var(--text-muted);
    font-family: var(--mono);
    flex-shrink: 0;
}

/* ═══ PLATFORM TILES (Dashboard) ═══ */
.platform-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.platform-tile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: 6px;
    background: var(--bg);
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.platform-tile:hover {
    background: var(--surface-2);
    border-color: var(--border);
}

.platform-tile-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5625rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.platform-tile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.platform-tile-name {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.platform-tile-status {
    font-size: 0.5625rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.platform-tile-status.status-ok { color: var(--success); }
.platform-tile-status.status-warn { color: var(--warning); }

.platform-tile-count {
    font-size: 0.6875rem;
    font-family: var(--mono);
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ═══ GEO MENTIONS ═══ */
.geo-mentions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.geo-mention-card {
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.geo-mention-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.geo-mention-platform {
    font-size: 0.5625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}

.geo-mention-query {
    font-size: 0.75rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.geo-mention-time {
    font-size: 0.625rem;
    color: var(--text-muted);
    font-family: var(--mono);
    flex-shrink: 0;
}

.geo-mention-excerpt {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══ STAT CARD GEO ═══ */
.stat-card-geo {
    position: relative;
}

.stat-card-geo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--accent), var(--success));
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
    .stats-grid, .stats { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
    .geo-metrics { grid-template-columns: repeat(2, 1fr); }
    .geo-hero { flex-direction: column; }
    .geo-hero-score { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 1rem; }
    .geo-hero-details { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ CONVERSATION PAGE ═══ */
.conv-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.conv-filter {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
}

.conv-filter:hover { border-color: var(--text-muted); color: var(--text); }

.conv-filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.conv-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.conv-filter-count {
    font-size: 0.625rem;
    opacity: 0.7;
    font-family: var(--mono);
}

.conv-list { display: flex; flex-direction: column; gap: 1.5rem; }

.conv-date-group { display: flex; flex-direction: column; gap: 0.5rem; }

.conv-date-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.conv-card {
    padding: 0.875rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.conv-card:hover { border-color: var(--text-muted); }

.conv-card.conv-mentioned { border-left: 3px solid var(--success); }

.conv-card-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.conv-platform-tag {
    font-size: 0.5625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}

.conv-query {
    font-size: 0.8125rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-badge-mention {
    font-size: 0.5625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: rgba(34,197,94,0.15);
    color: var(--success);
    font-weight: 600;
    flex-shrink: 0;
}

.conv-badge-no-mention {
    font-size: 0.5625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: rgba(161,161,170,0.1);
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.conv-answer-preview {
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.conv-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.625rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ═══ BRAND TERMS ═══ */
.brand-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.brand-term-chip {
    padding: 0.375rem 0.75rem;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

/* ═══ CARD COUNT ═══ */
.card-count {
    font-size: 0.6875rem;
    font-family: var(--mono);
    color: var(--text-muted);
    margin-left: auto;
}

/* ═══ COST BARS ═══ */
.cost-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cost-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cost-bar-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 120px;
}

.cost-bar-center {
    flex: 1;
    min-width: 0;
}

.cost-bar-track {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.cost-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.cost-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.6875rem;
    font-family: var(--mono);
    color: var(--text-muted);
    flex-shrink: 0;
}

.cost-bar-pct {
    font-weight: 600;
    color: var(--text);
    min-width: 36px;
    text-align: right;
}

.cost-bar-count { min-width: 40px; }

.cost-bar-cost { color: var(--accent); min-width: 60px; }

/* ═══ METHOD LIST ═══ */
.method-list { display: flex; flex-direction: column; gap: 0.5rem; }

.method-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    background: var(--bg);
}

.method-platform {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 70px;
}

.method-text {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: var(--mono);
    word-break: break-all;
}

/* ═══ PRICING TIERS ═══ */
.pricing-tiers {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.pricing-tier {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
}

.pricing-tier-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
}

/* ═══ DATA SOURCE LIST ═══ */
.data-source-list { display: flex; flex-direction: column; gap: 0; }

.data-source-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}

.data-source-row:last-child { border-bottom: none; }

.data-source-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.data-source-value {
    font-size: 0.75rem;
    font-family: var(--mono);
    color: var(--text);
}

/* ═══ DAILY TREND ═══ */
.daily-trend { display: flex; flex-direction: column; gap: 0.5rem; }

.trend-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.trend-date {
    font-size: 0.75rem;
    font-family: var(--mono);
    color: var(--text-muted);
    min-width: 44px;
}

.trend-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.trend-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width 0.6s ease;
}

.trend-count {
    font-size: 0.6875rem;
    font-family: var(--mono);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.trend-detail {
    font-size: 0.625rem;
    color: var(--text-muted);
    min-width: 100px;
}

/* ═══ SIDEBAR ENHANCEMENTS ═══ */
.sidebar { display: flex; flex-direction: column; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 0.5rem 0; }
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}
.sidebar-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
}
.sidebar-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    animation: pulse 2s infinite;
}
.sidebar-status.offline .sidebar-status-dot { background: var(--danger); animation: none; }
.sidebar-status-text { display: flex; flex-direction: column; gap: 0.125rem; }
.sidebar-status-text strong { color: var(--text); font-size: 0.75rem; }
.sidebar-status-text span { color: var(--text-muted); font-size: 0.625rem; }
.sidebar-status-hint { font-size: 0.625rem; color: var(--text-muted); margin-top: 0.375rem; }
.sidebar-db-info {
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.625rem;
}
.sidebar-db-label { color: var(--text-muted); }
.sidebar-db-value {
    color: var(--text);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.6875rem;
}
.sidebar-db-sync { color: var(--text-muted); font-size: 0.625rem; }

.topbar-db {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .topbar-db { display: none; }
}

.settings-value-db,
.settings-value-mono {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.8125rem;
}

.settings-system-banner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
}
.settings-system-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    animation: pulse 2s infinite;
}
.settings-system-banner.offline .settings-system-dot {
    background: var(--danger);
    animation: none;
}
.settings-system-banner-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.75rem;
}
.settings-system-banner-text strong {
    color: var(--text);
    font-size: 0.875rem;
}
.settings-system-banner-text span {
    color: var(--text-muted);
    font-size: 0.6875rem;
}

.nav-collapsible .nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-family: var(--font);
}
.nav-label-toggle { padding: 0; margin: 0; }
.nav-collapse-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}
.nav-collapsible.collapsed .nav-collapse-chevron { transform: rotate(-90deg); }
.nav-collapse-body {
    overflow: hidden;
    max-height: 600px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 1;
}
.nav-collapsible.collapsed .nav-collapse-body {
    max-height: 0;
    opacity: 0;
}
.nav-item-platform { padding-left: 1.25rem; }
.nav-platform-dot {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.nav-platform-name { flex: 1; text-align: left; }

.page-meta-tag {
    font-size: 0.6875rem;
    padding: 0.25rem 0.625rem;
    background: rgba(59,130,246,0.15);
    color: var(--accent);
    border-radius: 6px;
    font-weight: 500;
}

/* ═══ KEYWORDS & TABLES ═══ */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.data-table th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.data-table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); }
.mono { font-family: var(--mono); font-size: 0.75rem; }
.priority-badge {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}
.priority-p0, .mini-chart-fill.priority-p0 { background: #ef4444; }
.priority-p1, .mini-chart-fill.priority-p1 { background: #eab308; }
.priority-p2, .mini-chart-fill.priority-p2 { background: #6b7280; }
.cluster-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.cluster-chip {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
}
.cluster-chip.cert { border-color: rgba(34,197,94,0.3); color: var(--success); }
.cluster-chip-sm { font-size: 0.625rem; padding: 0.125rem 0.375rem; background: var(--bg); border-radius: 4px; color: var(--text-muted); }
.mini-chart-bars { display: flex; flex-direction: column; gap: 0.5rem; }
.mini-chart-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; }
.mini-chart-label { min-width: 24px; font-weight: 600; }
.mini-chart-track { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.mini-chart-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.5s ease; }
.mini-chart-val { min-width: 20px; text-align: right; font-family: var(--mono); }
.inline-bar { flex: 1; height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; min-width: 40px; }
.inline-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.inline-bar-cell { display: flex; align-items: center; gap: 0.5rem; }

/* ═══ CONTENT PRODUCTION ═══ */
.content-queue { display: flex; flex-direction: column; gap: 0.75rem; }
.content-queue-item {
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s;
}
.content-queue-item:hover { border-color: var(--accent); }
.content-queue-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.content-queue-id { font-family: var(--mono); font-size: 0.625rem; color: var(--text-muted); }
.content-queue-status { font-size: 0.75rem; }
.content-queue-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.5rem; }
.content-queue-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.content-queue-metrics { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.6875rem; color: var(--text-muted); }
.geo-tag { font-size: 0.625rem; background: rgba(59,130,246,0.2); color: var(--accent); padding: 0.125rem 0.375rem; border-radius: 4px; font-weight: 700; }
.status-scheduled { background: var(--accent); }
.status-generating { background: #a855f7; animation: pulse 1.5s infinite; }
.pipeline-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.pipeline-stage {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-radius: 8px;
    text-align: center;
    font-size: 0.75rem;
}
.pipeline-stage-name { font-weight: 600; color: var(--text); }
.pipeline-stage-count { color: var(--text-muted); font-size: 0.6875rem; }
.pipeline-arrow { color: var(--text-muted); }
.status-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.8125rem; }
.status-row-count { margin-left: auto; font-family: var(--mono); font-weight: 600; }

/* ═══ COMPETITORS ═══ */
.competitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.competitor-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.competitor-name { font-weight: 600; font-size: 0.875rem; }
.competitor-short { font-size: 0.75rem; color: var(--text-muted); }
.threat-badge { font-size: 0.625rem; padding: 0.25rem 0.5rem; border-radius: 6px; font-weight: 600; }
.threat-high { background: rgba(239,68,68,0.2); color: #ef4444; }
.threat-medium { background: rgba(234,179,8,0.2); color: #eab308; }
.threat-low { background: rgba(107,114,128,0.2); color: #9ca3af; }
.competitor-mentions-total { margin-bottom: 1rem; }
.competitor-mentions-num { font-size: 2rem; font-weight: 700; color: var(--accent); }
.competitor-platform-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; margin-bottom: 0.375rem; }
.competitor-platform-row .mini-chart-track { flex: 1; }
.strength-tag, .weakness-tag { font-size: 0.625rem; padding: 0.125rem 0.375rem; border-radius: 4px; margin: 0.125rem; display: inline-block; }
.strength-tag { background: rgba(34,197,94,0.15); color: var(--success); }
.weakness-tag { background: rgba(239,68,68,0.1); color: #f87171; }
.competitor-tag-group { margin-bottom: 0.5rem; }
.competitor-tag-label { font-size: 0.625rem; color: var(--text-muted); display: block; margin-bottom: 0.25rem; }
.competitor-budget { font-size: 0.6875rem; color: var(--text-muted); margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.share-bar-list { display: flex; flex-direction: column; gap: 0.625rem; }
.share-bar-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; }
.share-bar-name { min-width: 140px; color: var(--text-muted); }
.share-bar-track { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.share-bar-fill { height: 100%; background: var(--surface-2); border-radius: 4px; transition: width 0.6s ease; }
.share-bar-us .share-bar-name { color: var(--accent); font-weight: 600; }
.share-bar-val { min-width: 28px; text-align: right; font-family: var(--mono); font-weight: 600; }

/* ═══ EXECUTION LOGS ═══ */
.exec-log-timeline { display: flex; flex-direction: column; gap: 0.75rem; }
.exec-log-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    border-left: 3px solid var(--border);
}
.exec-log-item.log-success { border-left-color: var(--success); }
.exec-log-item.log-warning { border-left-color: var(--warning); }
.exec-log-item.log-error { border-left-color: var(--danger); }
.exec-log-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.exec-log-body { flex: 1; min-width: 0; }
.exec-log-top { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.25rem; }
.exec-log-task { font-weight: 600; font-size: 0.875rem; }
.exec-log-id { font-size: 0.625rem; color: var(--text-muted); }
.exec-log-detail { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.exec-log-metrics { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.5rem; }
.metric-chip { font-size: 0.625rem; padding: 0.125rem 0.375rem; background: var(--surface); border-radius: 4px; font-family: var(--mono); }
.exec-log-footer { display: flex; gap: 1rem; font-size: 0.6875rem; color: var(--text-muted); }

/* ═══ SYSTEM HEALTH ═══ */
.health-pill { font-size: 0.6875rem; padding: 0.25rem 0.625rem; border-radius: 6px; font-weight: 600; }
.health-ok { background: rgba(34,197,94,0.15); color: var(--success); }
.health-warn { background: rgba(239,68,68,0.15); color: var(--danger); }
.health-checklist { display: flex; flex-direction: column; gap: 0.5rem; }
.health-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.8125rem;
}
.health-check-icon { width: 24px; text-align: center; font-weight: 700; }
.health-check.ok .health-check-icon { color: var(--success); }
.health-check.fail .health-check-icon { color: var(--danger); }
.health-check-val { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); }
.platform-login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.platform-login-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg);
    border-radius: 8px;
    font-size: 0.75rem;
    opacity: 0.6;
}
.platform-login-item.logged-in { opacity: 1; border: 1px solid rgba(34,197,94,0.3); }
.platform-login-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.platform-login-item.logged-in .platform-login-dot { background: var(--success); }
.platform-login-status { margin-left: auto; font-size: 0.625rem; color: var(--text-muted); }
.hack-row { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.75rem; }
.hack-platform { font-weight: 600; display: block; margin-bottom: 0.25rem; text-transform: capitalize; }
.hack-method { color: var(--text-muted); font-family: var(--mono); font-size: 0.6875rem; }
.module-grid { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.module-chip {
    font-size: 0.6875rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-transform: capitalize;
}

/* ═══ KNOWLEDGE GRAPH & VOCABULARY ═══ */
.entity-profile { padding: 0.5rem 0; }
.entity-name { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.25rem; }
.entity-type { font-size: 0.75rem; color: var(--accent); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.entity-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 0.25rem; }
.relation-row {
    display: grid;
    grid-template-columns: 1fr auto 80px 40px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
}
.relation-target { font-weight: 500; }
.relation-type { font-size: 0.6875rem; color: var(--text-muted); }
.relation-strength { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.relation-strength-bar { height: 100%; background: var(--accent); border-radius: 2px; }
.assoc-network { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.assoc-node {
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
    opacity: calc(0.5 + var(--node-weight, 0.5) * 0.5);
}
.assoc-node-brand { border-color: var(--accent); background: rgba(59,130,246,0.1); }
.assoc-node-label { display: block; font-weight: 600; font-size: 0.8125rem; }
.assoc-node-type { font-size: 0.625rem; color: var(--text-muted); }
.usp-row {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}
.usp-platforms { grid-column: 1 / -1; font-size: 0.625rem; color: var(--text-muted); }
.action-list { padding-left: 1.25rem; font-size: 0.8125rem; color: var(--text-muted); }
.action-list li { margin-bottom: 0.5rem; }
.disambiguation-warn {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(234,179,8,0.1);
    border: 1px solid rgba(234,179,8,0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--warning);
}
.entity-row { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.entity-row-name { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.25rem; }
.entity-row-metrics { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text-muted); }
.tfidf-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr 36px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
}
.tfidf-keyword { font-weight: 500; }
.longtail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.longtail-item {
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.longtail-keyword { font-size: 0.8125rem; font-weight: 500; margin-bottom: 0.25rem; }
.longtail-score { font-size: 0.625rem; color: var(--success); }
.history-snapshot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.history-snapshot-card {
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
}
.history-snapshot-date { font-weight: 700; font-size: 0.875rem; margin-bottom: 0.5rem; }
.history-snapshot-stats { display: flex; justify-content: center; gap: 1rem; font-size: 0.75rem; color: var(--text-muted); }
.empty-hint { font-size: 0.75rem; color: var(--text-muted); padding: 1rem 0; }

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .topbar { left: 0; }
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    }
    .main { margin-left: 0; width: 100%; padding: 1rem; }
    .stats-grid, .stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .stat-value { font-size: 1.25rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .page-actions { width: 100%; }
    .content-grid { grid-template-columns: 1fr; }
    .card { padding: 1rem; }
    table { font-size: 0.75rem; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    thead, tbody { display: table; width: 100%; table-layout: fixed; }
    th, td { padding: 0.5rem 0.5rem; }
    .article-title { max-width: 120px; }
    .modal { max-width: 100%; margin: 0.5rem; }
    .geo-metrics { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .geo-metric-card { padding: 14px; }
    .geo-metric-value { font-size: 24px; }
    .geo-platforms { grid-template-columns: 1fr; }
    body.sidebar-open { overflow: hidden; }
    .date-nav { margin-bottom: 1rem; }
    .competitor-grid { grid-template-columns: 1fr; }
    .relation-row { grid-template-columns: 1fr; gap: 0.25rem; }
    .share-bar-name { min-width: 80px; font-size: 0.6875rem; }
    .platform-login-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .topbar { padding: 0 1rem; }
    .stats-grid, .stats { grid-template-columns: 1fr; }
    .stat-card { padding: 1rem; }
    .content-grid { gap: 1rem; }
    .page-header h2 { font-size: 1.125rem; }
    th, td { padding: 0.375rem 0.375rem; font-size: 0.6875rem; }
    .article-title { max-width: 90px; }
    .platform-icon { width: 30px; height: 30px; font-size: 0.6875rem; }
    .platform-name { font-size: 0.75rem; }
    .tag { font-size: 0.625rem; padding: 0.125rem 0.375rem; }
    .date-chip { min-width: 60px; padding: 0.5rem 0.75rem; }
    .date-chip-day { font-size: 1rem; }
}
