:root {
    --bg: #f1f3f6;
    --bg-accent: #e8eef5;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #5b6474;
    --line: #e2e8f0;
    --primary: #0f4c5c;
    --primary-dark: #0a3944;
    --accent: #f77f00;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --radius: 18px;
    --status-red: #e74c3c;
    --status-yellow: #f1c40f;
    --status-green: #2ecc71;
    --status-neutral: #cbd5e1;
    --status-ring: rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: #eef2f7;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.6;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 18px 56px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 28px;
    padding: 26px 26px 30px;
    background: linear-gradient(140deg, #ffffff 0%, #f4f7fb 70%);
    border-radius: 26px;
    border: 1px solid #e5ebf3;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}


.hero-content h1 {
    font-family: "Sora", "Noto Sans TC", sans-serif;
    font-size: 36px;
    margin: 6px 0 10px;
    letter-spacing: 0.5px;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.lead {
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--text);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 76, 92, 0.08);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.hero-panel {
    background: #0f4c5c;
    color: #f8fafc;
    border-radius: 20px;
    padding: 20px 22px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.panel-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.checklist {
    margin: 0;
    padding-left: 18px;
}

.checklist li {
    margin: 8px 0;
    color: #f8fafc;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "rate result"
        "mode guide";
    gap: 22px;
    margin-top: 30px;
    align-items: stretch;
}

.card-rate {
    grid-area: rate;
}

.card-result {
    grid-area: result;
}

.card-mode {
    grid-area: mode;
}

.card-guide {
    grid-area: guide;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    animation: rise 0.5s ease both;
    height: 100%;
}

.card.highlight {
    border: 1px solid rgba(15, 76, 92, 0.25);
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

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

.card-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.card-header:hover {
    opacity: 0.7;
}

.collapse-icon {
    display: inline-block;
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s ease;
    line-height: 1;
}

.card.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.card-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.card.collapsed .card-content {
    max-height: 0;
    opacity: 0;
}

h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-family: "Sora", "Noto Sans TC", sans-serif;
}

p {
    margin: 10px 0;
    color: var(--text);
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.muted-555 {
    color: #556070;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.flex-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-inline {
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.field {
    display: grid;
    gap: 6px;
    margin: 12px 0;
}

.field label {
    font-weight: 600;
    font-size: 14px;
    color: #3a475a;
}

.field-group {
    margin-top: 12px;
    display: grid;
    gap: 6px;
}

input[type="number"],
select {
    width: min(420px, 100%);
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

input[type="number"]:focus,
select:focus {
    border-color: rgba(15, 76, 92, 0.6);
    box-shadow: 0 0 0 3px rgba(15, 76, 92, 0.12);
}

.hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

button {
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 10px 20px rgba(15, 76, 92, 0.2);
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

#demoBtn {
    background: #ffffff;
    color: var(--primary);
    border: 1px solid rgba(15, 76, 92, 0.3);
    box-shadow: none;
}

#demoBtn:hover {
    background: rgba(15, 76, 92, 0.08);
}

#result {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px dashed rgba(15, 76, 92, 0.3);
    background: #f8fafc;
    border-radius: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 90px;
    font-family: "Sora", "Noto Sans TC", sans-serif;
    font-size: 14px;
}

.status-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    color: #3a475a;
}

.status-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 14px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
    background: var(--status-neutral);
    box-sizing: border-box;
    border: 2px solid var(--status-ring);
}

.status-dot--lg {
    width: 14px;
    height: 14px;
    border-width: 3px;
}

.status-dot--sm {
    width: 10px;
    height: 10px;
    border-width: 2px;
}

.status-dot.is-red {
    background: var(--status-red);
}

.status-dot.is-yellow {
    background: var(--status-yellow);
}

.status-dot.is-green {
    background: var(--status-green);
}

a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(15, 76, 92, 0.3);
    padding-bottom: 2px;
}

a:hover {
    opacity: 0.8;
}

.footer {
    margin-top: 24px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border: 1px solid var(--line);
}

@media (max-width: 960px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .content-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "rate"
            "mode"
            "result"
            "guide";
    }
}

@media (max-width: 600px) {
    .page {
        padding: 24px 14px 48px;
    }
    .hero {
        padding: 22px 18px;
    }
    .hero-content h1 {
        font-size: 28px;
    }
    button {
        width: 100%;
    }
    .btn-row {
        flex-direction: column;
    }
    input[type="number"],
    select {
        width: 100%;
    }
}
