:root {
    --bg: #07110f;
    --bg-soft: #0d1a17;
    --panel: rgba(15, 30, 26, 0.86);
    --panel-strong: #11251f;
    --border: rgba(129, 171, 155, 0.22);
    --text: #edf6f0;
    --muted: #94aba0;
    --accent: #8ec5a8;
    --accent-strong: #5faa82;
    --danger: #ff8f8f;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Noto Sans TC", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(121, 170, 145, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(94, 138, 118, 0.2), transparent 28%),
        linear-gradient(160deg, #040807 0%, #08110f 38%, #0d1815 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar,
.panel-card,
.list-card,
.stat-card,
.hero-card {
    backdrop-filter: blur(18px);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.sidebar {
    padding: 28px 20px;
    border-right: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 28px;
}

.brand-mark {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #c8f0d8);
    box-shadow: 0 0 28px rgba(142, 197, 168, 0.7);
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a,
.ghost-link,
.tab-row a {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--muted);
    transition: 160ms ease;
}

.nav a.active,
.nav a:hover,
.ghost-link:hover,
.tab-row a.active {
    color: var(--text);
    background: rgba(142, 197, 168, 0.12);
}

.sidebar-user {
    margin-top: 28px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 6px;
}

.eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 12px;
}

.content {
    padding: 28px;
    display: grid;
    gap: 24px;
}

.page-head,
.panel-grid,
.stats-grid,
.hero-grid {
    display: grid;
    gap: 20px;
}

.page-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

h1,
h2,
p {
    margin: 0;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-grid {
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
}

.stat-card,
.panel-card,
.list-card,
.hero-card {
    padding: 24px;
    border-radius: 28px;
}

.stat-card span,
.list-row span,
.helper {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 36px;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.stack-form label {
    display: grid;
    gap: 8px;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

textarea {
    resize: vertical;
}

.primary-btn,
.line-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 14px 20px;
    border: 0;
    border-radius: 18px;
    color: #04100b;
    background: linear-gradient(135deg, var(--accent), #d4f5df);
    font-weight: 700;
    cursor: pointer;
}

.line-btn.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

.divider {
    position: relative;
    text-align: center;
    color: var(--muted);
    margin: 8px 0;
}

.divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid var(--border);
}

.divider span {
    position: relative;
    padding: 0 12px;
    background: var(--panel);
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.flash.success {
    background: rgba(95, 170, 130, 0.16);
}

.flash.error {
    background: rgba(255, 143, 143, 0.12);
    color: #ffd1d1;
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.list-row:last-child {
    border-bottom: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(142, 197, 168, 0.12);
    color: var(--accent);
}

.amount {
    font-weight: 700;
}

.empty-state {
    padding: 30px 0 8px;
    color: var(--muted);
}

.login-body {
    display: grid;
    place-items: center;
    padding: 36px 20px;
}

.login-shell {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 24px;
}

.hero-card h1 {
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.02;
    margin: 18px 0 16px;
    max-width: 10ch;
}

.hero-card p {
    max-width: 54ch;
    color: var(--muted);
}

.hero-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
}

.hero-grid div {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 8px;
}

.tab-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 18px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.legal-links {
    margin: 14px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.legal-links a {
    color: var(--accent);
}

.legal-body {
    padding: 36px 20px;
}

.legal-shell {
    width: min(920px, 100%);
}

.legal-card {
    padding: 28px;
    border-radius: 28px;
    backdrop-filter: blur(18px);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.legal-card h1 {
    margin-top: 14px;
    font-size: clamp(34px, 5vw, 52px);
}

.legal-updated {
    margin-top: 10px;
    color: var(--muted);
}

.legal-section {
    margin-top: 26px;
    display: grid;
    gap: 10px;
}

.legal-section h2 {
    font-size: 20px;
}

.legal-section p {
    color: var(--muted);
    line-height: 1.8;
}

.legal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 32px;
}

@media (max-width: 980px) {
    .shell,
    .login-shell,
    .panel-grid,
    .stats-grid,
    .hero-grid,
    .page-head {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding-bottom: 12px;
    }
}
