@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

:root {
    --bg-soft: #f6f7fb;
    --bg-hero: linear-gradient(145deg, #0f172a 0%, #1d4ed8 45%, #7c3aed 100%);
    --bg-hero-cyan: linear-gradient(145deg, #082f49 0%, #0369a1 42%, #14b8a6 100%);
    --bg-hero-rose: linear-gradient(145deg, #3b0764 0%, #7e22ce 42%, #ec4899 100%);
    --bg-hero-slate: linear-gradient(145deg, #111827 0%, #1e293b 45%, #475569 100%);
    --card-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
    --line-soft: rgba(148, 163, 184, 0.22);
}

* {
    box-sizing: border-box;
}

body.lite-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Noto Sans TC', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.15), transparent 30%),
        radial-gradient(circle at top right, rgba(244, 114, 182, 0.12), transparent 28%),
        var(--bg-soft);
    color: #0f172a;
}

.page-shell {
    max-width: 460px;
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.hero-card {
    margin: 14px 14px 0;
    padding: 16px 16px 18px;
    border-radius: 24px;
    background: var(--bg-hero);
    color: #fff;
    box-shadow: 0 24px 48px rgba(37, 99, 235, 0.28);
    position: sticky;
    top: 12px;
    z-index: 20;
    overflow: hidden;
}

.hero-card.hero-cyan {
    background: var(--bg-hero-cyan);
    box-shadow: 0 24px 48px rgba(8, 47, 73, 0.28);
}

.hero-card.hero-rose {
    background: var(--bg-hero-rose);
    box-shadow: 0 24px 48px rgba(91, 33, 182, 0.26);
}

.hero-card.hero-slate {
    background: var(--bg-hero-slate);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24);
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -56px;
    top: -48px;
    width: 160px;
    height: 160px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    filter: blur(2px);
}

.hero-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.hero-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.hero-logo {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.back-link {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    text-decoration: none;
}

.hero-eyebrow {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 4px;
}

.hero-title {
    font-size: 24px;
    line-height: 1.1;
    font-weight: 900;
    margin: 0;
}

.hero-subtitle {
    margin-top: 12px;
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    line-height: 1.6;
}

.hero-display {
    margin-top: 14px;
    position: relative;
    z-index: 1;
    font-family: 'DM Serif Display', serif;
    font-size: 30px;
    line-height: 1;
    letter-spacing: 0.03em;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #86efac;
    box-shadow: 0 0 0 4px rgba(134, 239, 172, 0.18);
}

.content-stack {
    flex: 1;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.surface-card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(18px);
    border-radius: 22px;
}

.section-title {
    font-size: 13px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 10px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.metric-card {
    border-radius: 18px;
    padding: 12px 10px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92));
    border: 1px solid var(--line-soft);
    text-align: center;
}

.metric-card .eyebrow {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
}

.metric-card .value {
    font-size: 22px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
}

.metric-card .hint {
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.action-tile {
    border: 0;
    border-radius: 22px;
    padding: 18px 14px;
    color: white;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.action-tile:active {
    transform: scale(0.98);
}

.action-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px rgba(15, 23, 42, 0.18);
}

.action-blue {
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
}

.action-orange {
    background: linear-gradient(145deg, #f97316, #ea580c);
}

.action-violet {
    background: linear-gradient(145deg, #7c3aed, #6d28d9);
}

.action-emerald {
    background: linear-gradient(145deg, #10b981, #059669);
}

.action-slate {
    background: linear-gradient(145deg, #334155, #0f172a);
}

.nav-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: #eef2ff;
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.nav-button:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.segmented {
    display: flex;
    padding: 4px;
    border-radius: 16px;
    background: rgba(226, 232, 240, 0.72);
    gap: 6px;
}

.segmented button {
    flex: 1;
    border: 0;
    padding: 10px 8px;
    border-radius: 12px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s ease;
}

.segmented button.active,
.segmented button.is-active {
    background: white;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.info-note {
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    min-width: 300px;
    max-width: 90%;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(16px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.98), rgba(5, 150, 105, 0.98));
    color: white;
}

.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.98), rgba(220, 38, 38, 0.98));
    color: white;
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-weight: 600;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(6px);
}

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

.modal-content {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border-radius: 24px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    animation: slideUp 0.3s ease;
}

.empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 52px 20px;
}

.footer-note {
    text-align: center;
    padding: 8px 14px 18px;
    font-size: 11px;
    color: #94a3b8;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 420px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }
}
