/* ============================================================
   算法演示中心 — Dark Tech Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-primary: #080c14;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --accent: #00d4ff;
    --accent-dim: rgba(0, 212, 255, 0.15);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.06);
    --danger: #f87171;
    --success: #34d399;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Subtle grid overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* Radial ambient glow */
body::after {
    content: '';
    position: fixed;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(0, 212, 255, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

main {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* ---- Navbar ---- */
.navbar {
    background: rgba(8, 12, 20, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 10;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
}

.navbar-brand {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: var(--text-primary) !important;
    transition: color 0.2s;
}

.navbar-brand:hover {
    color: var(--accent) !important;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--accent) !important;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.3px;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }

.text-muted { color: var(--text-secondary) !important; }

/* ---- Buttons ---- */
.btn {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    border-radius: 6px;
    padding: 6px 14px;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.btn-sm {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 5px;
}

.btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #080c14;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.35), inset 0 0 12px rgba(0, 212, 255, 0.06);
}

.btn-outline-primary {
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--accent);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.15);
}

.btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.18);
    color: var(--text-primary);
}

.btn-outline-danger {
    border-color: rgba(248, 113, 113, 0.2);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.5);
    color: #fca5a5;
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.1);
}

.btn-lg {
    padding: 10px 22px;
    font-size: 0.85rem;
}

/* ---- Cards ---- */
.demo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.demo-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 212, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 212, 255, 0.08);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-footer {
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
}

/* ---- Alerts ---- */
.alert {
    background: rgba(17, 24, 39, 0.9);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    backdrop-filter: blur(8px);
}

.alert-success {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.08);
}

.alert-danger {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.08);
}

/* ---- Forms ---- */
.form-control {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px 14px;
    transition: all 0.2s;
}

.form-control:focus {
    background: rgba(17, 24, 39, 0.95);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ---- Upload Card ---- */
.upload-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.upload-card .card-body {
    padding: 2rem;
}

/* ---- Empty State ---- */
.empty-state {
    padding: 100px 0;
}

.empty-state svg {
    opacity: 0.2;
}

.empty-state h3 {
    font-weight: 500;
}

/* ---- Demo Page ---- */
.demo-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 90px);
}

.demo-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.demo-toolbar-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-meta {
    padding-top: 0.6rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ---- Demo Viewer ---- */
.demo-viewer {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 500px;
    margin: 0.75rem 0;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
}

.demo-viewer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.demo-viewer.is-fullscreen {
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .demo-viewer { height: 50vh; }
    .empty-state { padding: 60px 0; }
    .upload-card .card-body { padding: 1.25rem; }
}
