:root {
    color-scheme: light dark;
    --bg: #0d1117;
    --panel: rgba(13, 17, 23, 0.85);
    --panel-border: rgba(240, 246, 252, 0.15);
    --text: #f0f6fc;
    --accent: #58a6ff;
    --accent-soft: rgba(88, 166, 255, 0.1);
    --muted: #8b949e;
    --danger: #f85149;
    --success: #3fb950;
    --warning: #d29922;
    font-family: "Segoe UI", "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #020817, #0f172a);
    min-height: 100vh;
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

header {
    background: rgba(2, 6, 23, 0.9);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
}

.navbar {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.6px;
}

.navbar-brand:hover {
    text-decoration: none;
}

.navbar-links {
    display: flex;
    gap: 20px;
}

.navbar a {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.35);
}

.how-it-works .lead {
    margin-bottom: 18px;
    font-size: 1.05rem;
    color: #c7d2fe;
}

.guide-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.guide-card {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}

.guide-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.guide-card ul {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
}

.guide-card li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.guide-card li strong {
    color: #f8fafc;
}

.guide-tip {
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #22d3ee, #2563eb);
    color: #0b1120;
    box-shadow: 0 16px 30px rgba(14, 165, 233, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-button:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.45);
}

.cta-button.secondary {
    background: rgba(59, 130, 246, 0.15);
    color: #e0f2fe;
    box-shadow: none;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.cta-button.secondary:hover {
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.35);
}

.cta-button.ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.5);
    box-shadow: none;
}

.cta-button.ghost:hover {
    box-shadow: 0 10px 24px rgba(88, 166, 255, 0.3);
}

.manual-hero,
.doc-hero {
    max-width: 940px;
    margin: 0 auto 32px;
    text-align: center;
    border-radius: 16px;
    border: 1px solid rgba(125, 211, 252, 0.35);
}

.manual-hero {
    background: linear-gradient(135deg, rgba(15, 118, 220, 0.25), rgba(110, 231, 183, 0.18));
}

.doc-hero {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.2), rgba(59, 130, 246, 0.18));
}

.doc-hero.privacy {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.22), rgba(45, 212, 191, 0.18));
    border-color: rgba(94, 234, 212, 0.38);
}

.doc-hero.disclaimer {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.22), rgba(249, 115, 22, 0.18));
    border-color: rgba(251, 191, 36, 0.35);
}

.manual-hero h1,
.doc-hero h1 {
    margin-bottom: 12px;
}

.manual-hero .lead,
.doc-hero .lead {
    font-size: 1.05rem;
    margin-bottom: 20px;
    color: #e0f2fe;
}

.manual-highlights,
.doc-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    font-size: 0.95rem;
    color: #cffafe;
}

.manual-highlights span,
.doc-highlights span {
    background: rgba(15, 23, 42, 0.35);
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.manual-grid {
    display: grid;
    gap: 24px;
}

.manual-section header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.manual-icon {
    font-size: 2.4rem;
}

.manual-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
}

.manual-steps {
    counter-reset: manual-step;
    list-style: none;
    margin: 0;
    padding: 0;
}

.manual-steps li {
    position: relative;
    padding-left: 44px;
    margin-bottom: 18px;
    line-height: 1.6;
}

.manual-steps li::before {
    counter-increment: manual-step;
    content: counter(manual-step);
    position: absolute;
    left: 0;
    top: 2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.28);
    border: 1px solid rgba(56, 189, 248, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #e0f2fe;
}

.manual-tip {
    background: rgba(30, 64, 175, 0.18);
    border-left: 3px solid rgba(59, 130, 246, 0.6);
    padding: 12px 16px;
    border-radius: 12px;
    color: #bfdbfe;
    margin: 18px 0 0;
}

.doc-section {
    max-width: 860px;
    margin: 0 auto 24px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.35);
}

.doc-section h2 {
    margin-top: 0;
}

.doc-subtitle {
    color: var(--muted);
    margin-bottom: 16px;
}

.doc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-list li {
    position: relative;
    padding-left: 36px;
    margin-bottom: 14px;
    line-height: 1.65;
}

.doc-list li::before {
    content: "✦";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1rem;
    color: #a5b4fc;
}

.doc-list li strong {
    color: #f9fafb;
}

.doc-tip {
    background: rgba(20, 83, 136, 0.2);
    border-left: 3px solid rgba(96, 165, 250, 0.6);
    padding: 12px 18px;
    border-radius: 12px;
    color: #dbeafe;
    margin-top: 18px;
}

.doc-section.disclaimer {
    background: rgba(120, 53, 15, 0.22);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.doc-section.disclaimer .doc-tip {
    background: rgba(146, 64, 14, 0.25);
    border-left-color: rgba(249, 115, 22, 0.7);
    color: #fed7aa;
}

.doc-footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 24px;
}

.doc-footer a {
    color: var(--accent);
}

.activity-hero {
    position: relative;
    max-width: 960px;
    margin: 0 auto 32px;
    padding: 46px 42px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.3), rgba(2, 6, 23, 0.7));
    overflow: hidden;
}

.activity-hero.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--cover, none);
    background-size: cover;
    background-position: center;
    filter: brightness(0.6) saturate(1.1);
    z-index: 0;
}

.activity-hero.has-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.85), rgba(30, 64, 175, 0.5));
    z-index: 0;
}

.activity-hero > * {
    position: relative;
    z-index: 1;
}

.activity-hero h1 {
    margin: 0 0 12px;
    font-size: 2.1rem;
}

.activity-hero .activity-subtitle {
    color: #cbd5f5;
    font-size: 1rem;
    margin-bottom: 18px;
}

.activity-hero .activity-period {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #e0f2fe;
    font-weight: 600;
}

.activity-detail {
    max-width: 960px;
    margin: 0 auto 40px;
    display: grid;
    gap: 24px;
}

.activity-info-grid {
    display: grid;
    gap: 18px;
}

.activity-info-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.32);
}

.activity-info-card h3 {
    margin-top: 0;
}

.activity-info-grid .info-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #cbd5f5;
}

.activity-info-grid .info-line strong {
    color: #f9fafb;
}

.activity-description-full {
    line-height: 1.8;
    font-size: 1.02rem;
    color: #e2e8f0;
}

.activity-cta-box {
    background: rgba(37, 99, 235, 0.22);
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.25);
}

.activity-cta-box h3 {
    margin-top: 0;
}

.activity-cta-box p {
    margin-bottom: 14px;
}

.activity-cta-box .cta-button {
    padding: 12px 24px;
}

.activity-cta-box .hint {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

.manual-section.merchant {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.manual-section.consumer {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

@media (min-width: 840px) {
    .manual-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-info-grid {
        grid-template-columns: 2fr 1fr;
    }
}

@media (max-width: 520px) {
    .manual-steps li {
        padding-left: 36px;
    }

    .manual-steps li::before {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }

    .doc-list li {
        padding-left: 30px;
    }

    .activity-hero {
        padding: 34px 22px;
    }
}

.card h2,
.card h3 {
    margin-top: 0;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--panel-border);
    text-align: left;
}

th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge.warning { background: rgba(210, 153, 34, 0.15); color: var(--warning); }
.badge.success { background: rgba(63, 185, 80, 0.15); color: var(--success); }
.badge.danger { background: rgba(248, 81, 73, 0.15); color: var(--danger); }
.badge.info { background: rgba(88, 166, 255, 0.15); color: var(--accent); }

.flash {
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.flash.success { border-color: rgba(63, 185, 80, 0.3); background: rgba(63, 185, 80, 0.12); }
.flash.info { border-color: rgba(88, 166, 255, 0.3); background: rgba(88, 166, 255, 0.12); }
.flash.warning { border-color: rgba(210, 153, 34, 0.3); background: rgba(210, 153, 34, 0.12); }
.flash.danger { border-color: rgba(248, 81, 73, 0.3); background: rgba(248, 81, 73, 0.12); }

button,
input[type="submit"],
input[type="button"] {
    background: linear-gradient(135deg, #1f2937, #2563eb);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.04em;
}

button.secondary,
input.secondary {
    background: rgba(21, 94, 239, 0.12);
    color: var(--accent);
}

.oauth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--panel-border);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

.oauth-button:hover {
    text-decoration: none;
    background: #f8fafc;
}

label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    padding: 10px 12px;
    background: rgba(2, 6, 23, 0.6);
    color: var(--text);
}

textarea {
    min-height: 120px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 4px;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
}

.stat-card h4 {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.stat-card p {
    margin: 8px 0 0;
    font-size: 1.8rem;
    font-weight: 700;
}

footer {
    margin-top: 60px;
    border-top: 1px solid var(--panel-border);
    padding: 24px;
    text-align: center;
    color: var(--muted);
    background: rgba(2, 6, 23, 0.7);
}

.hero {
    text-align: center;
    padding: 60px;
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.2), rgba(2, 6, 23, 0));
    border-radius: 24px;
    border: 1px solid var(--panel-border);
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.4rem;
    margin: 0 0 12px;
}

.hero p {
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
}

.hero-logo {
    margin: 0 auto 24px;
    height: 96px;
    width: auto;
    display: block;
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.activity-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.32);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.activity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.45);
}

.activity-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    filter: saturate(1.1);
}

.activity-card-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(37, 99, 235, 0.18));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(226, 232, 240, 0.85);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.activity-card-header {
    position: relative;
    overflow: hidden;
}

.activity-card-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0) 30%, rgba(2, 6, 23, 0.75) 100%);
}

.activity-card-badge {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 1;
    background: rgba(15, 23, 42, 0.7);
    color: #e0f2fe;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.activity-card-body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-card-body h3 {
    margin: 0;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--muted);
}

.activity-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.activity-description {
    color: #e2e8f0;
    line-height: 1.7;
    min-height: 72px;
}

.activity-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.activity-actions .cta-button,
.activity-actions a.cta-button {
    padding: 10px 20px;
    font-size: 0.92rem;
}

.activity-actions .link-muted {
    color: var(--muted);
    font-size: 0.85rem;
}

small {
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        gap: 12px;
    }
}
