/* === Swiss International Typographic Style === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap');

/* === Design Tokens === */
:root {
    --bg: #FFFFFF;
    --fg: #000000;
    --muted: #F2F2F2;
    --accent: #FF3000;
    --border: #000000;
    --font: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

/* === Reset & Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    padding: 24px;
    min-height: 100vh;
    position: relative;
}

/* Noise texture overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Grid pattern texture */
.swiss-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

.container {
    max-width: 520px;
    margin: 0 auto;
}

/* === Section Label (01. CONSENT, 02. ANNOTATE, etc.) === */
.section-label {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 20px;
}

/* === Consent Page === */
.consent-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 48px);
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 40px 0;
}

.consent-title {
    font-size: clamp(2.5rem, 10vw, 5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 0.95;
    margin-bottom: 28px;
    color: var(--fg);
}

.consent-subtitle {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    color: var(--fg);
    opacity: 0.6;
    margin-bottom: 40px;
    max-width: 400px;
}

.consent-check-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fg);
    padding: 16px;
    border: 2px solid var(--border);
    transition: border-color 0.15s ease-out;
    user-select: none;
}

.consent-check-label:hover {
    border-color: var(--accent);
}

.consent-check-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--fg);
    flex-shrink: 0;
}

.btn-start {
    display: inline-block;
    background: var(--fg);
    color: var(--bg);
    border: 2px solid var(--fg);
    padding: 16px 48px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}

.btn-start:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.btn-start:disabled {
    background: var(--muted);
    border-color: var(--muted);
    color: #999;
    cursor: not-allowed;
}

.btn-start:not(:disabled):active {
    transform: scale(0.98);
}

/* === Annotate Page === */
.annotate-page {
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    padding-top: 15vh;
    padding-bottom: 10vh;
}

.progress-bar {
    display: flex;
    align-items: center;
    color: var(--fg);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.progress-bar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-bpe-demo {
    background: var(--bg);
    color: var(--fg);
    border: 1.5px solid var(--fg);
    padding: 5px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font);
    letter-spacing: 0.05em;
    cursor: pointer;
    text-transform: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-bpe-demo:hover {
    background: var(--fg);
    color: var(--bg);
}

.btn-bpe-demo:active {
    transform: scale(0.97);
}

.count-num {
    font-weight: 900;
    color: var(--fg);
    font-size: 1.2rem;
    margin: 0 2px;
}

.count-total {
    font-weight: 700;
    color: #999;
    font-size: 0.95rem;
}

.token-display {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    padding: 40px 20px;
    margin-bottom: 20px;
    background: var(--bg);
    border: 4px solid var(--border);
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    position: relative;
}

/* Dot pattern inside token display */
.token-display::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px);
    background-size: 16px 16px;
}

.token-display-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.token-meta {
    font-size: 0.75rem;
    font-weight: 500;
    color: #999;
    letter-spacing: 0.02em;
}

.token-display.fade-in {
    animation: fadeIn 0.2s ease-out;
}

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

/* === Card Grid === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

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

/* === Choice Card === */
.choice-card {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 14px 14px 12px;
    cursor: pointer;
    transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.choice-card:hover {
    border-color: var(--accent);
}

.choice-card:active {
    transform: scale(0.97);
}

/* Selected: full color inversion */
.choice-card.selected {
    background: var(--fg);
    border-color: var(--fg);
    color: var(--bg);
}

.choice-card.selected .card-icon {
    color: var(--bg);
}

.choice-card.selected .card-label {
    color: var(--bg);
}

.choice-card.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card-icon {
    width: 22px;
    height: 22px;
    color: var(--fg);
    flex-shrink: 0;
}

/* Radio indicator — square for Swiss style */
.radio-dot {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s ease-out, background 0.15s ease-out;
}

.choice-card.selected .radio-dot {
    border-color: var(--bg);
    background: var(--bg);
}

.choice-card.selected .radio-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--fg);
}

.card-label {
    display: block;
    text-align: left;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: 0.02em;
}

/* === Tooltip === */
.tooltip-wrap {
    position: relative;
}

.tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--fg);
    color: var(--bg);
    padding: 14px 16px;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.7;
    width: 280px;
    text-align: left;
    border: 2px solid var(--fg);
    z-index: 10;
    pointer-events: none;
}

.tooltip em {
    color: var(--accent);
    font-style: normal;
}

/* No arrow — Swiss style direct positioning */

.tooltip-wrap:hover .tooltip {
    display: block;
}

/* === Step 2 Header === */
.step2-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.step2-label {
    font-size: 0.85rem;
    color: var(--fg);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.back-btn {
    background: none;
    border: 2px solid var(--border);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}

.back-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

/* === Reason Section === */
.reason-section {
    margin-bottom: 16px;
}

.reason-section summary {
    cursor: pointer;
    color: var(--fg);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 0;
}

.reason-section textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 2px solid var(--border);
    font-size: 0.9rem;
    margin-top: 8px;
    resize: vertical;
    font-family: var(--font);
    background: transparent;
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s ease-out;
}

.reason-section textarea:focus {
    border-bottom-color: var(--accent);
}

/* === Complete Message === */
.complete-msg {
    text-align: left;
    padding: 60px 0;
}

.complete-msg h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.complete-msg p {
    color: var(--fg);
    opacity: 0.6;
    font-size: 1rem;
}

/* === Summary Page === */
.summary-page {
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.summary-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border: 2px solid var(--border);
    margin-bottom: 24px;
    transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}

.summary-back:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.summary-card {
    background: var(--bg);
    border: 4px solid var(--border);
    padding: 28px 24px;
    width: 100%;
    max-width: 400px;
    position: relative;
    align-self: center;
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.summary-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.summary-icon {
    width: 36px;
    height: 36px;
    background: var(--fg);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-icon svg {
    width: 18px;
    height: 18px;
}

/* Radial progress */
.radial-wrap {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radial-svg {
    position: relative;
    z-index: 1;
}

.radial-center {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.radial-value {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--fg);
    line-height: 1;
}

.radial-status {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fg);
    opacity: 0.5;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Token orbit */
.token-orbit {
    position: absolute;
    width: 280px;
    height: 280px;
    top: 0;
    left: 0;
    z-index: 3;
    animation: orbit-spin 200s linear infinite;
}

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.orbit-token {
    position: absolute;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--fg);
    background: var(--bg);
    padding: 2px 5px;
    border: 1.5px solid var(--border);
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.02em;
    animation: orbit-counter-spin 200s linear infinite;
}

@keyframes orbit-counter-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(-360deg); }
}

.summary-footer {
    text-align: left;
    padding-top: 12px;
}

.summary-global {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Summary progress line */
.summary-progress-line {
    text-align: center;
    padding-top: 16px;
    font-size: 1rem;
    font-weight: 500;
    color: #999;
    letter-spacing: 0.02em;
}

.summary-progress-line .progress-current {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--fg);
}

.summary-progress-line .progress-total {
    font-size: 1rem;
    font-weight: 700;
    color: #bbb;
}

/* Summary link on annotate page */
.summary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
    text-decoration: none;
    vertical-align: middle;
}

.summary-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.summary-link svg {
    width: 16px;
    height: 16px;
}

/* === Reward Modal === */
.reward-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.reward-modal {
    background: var(--bg);
    border: 2px solid var(--fg);
    border-radius: 16px;
    padding: 36px 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.reward-badge {
    font-size: 48px;
    margin-bottom: 12px;
}

.reward-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 12px;
    color: var(--fg);
}

.reward-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
    margin: 0 0 20px;
}

.reward-desc strong {
    color: var(--accent);
    font-weight: 700;
}

.reward-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid var(--fg);
    border-radius: 10px;
    outline: none;
    text-align: center;
    letter-spacing: 2px;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.reward-input:focus {
    border-color: var(--accent);
}

.reward-error {
    color: var(--accent);
    font-size: 0.8rem;
    margin: 8px 0 0;
}

.reward-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--bg);
    background: var(--fg);
    border: 2px solid var(--fg);
    border-radius: 10px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.reward-btn:active {
    background: var(--accent);
    border-color: var(--accent);
}

/* === SMS Verification Code === */
.sms-phone-row {
    width: 100%;
}

.sms-code-step {
    width: 100%;
}

.sms-phone-disabled {
    background: #F5F5F5;
    color: #999;
    border-color: #DDD;
}

.sms-code-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
}

.sms-code-input {
    flex: 1;
    min-width: 0;
    font-size: 1.2rem;
    letter-spacing: 6px;
    padding: 14px 12px;
}

.sms-resend-btn {
    flex-shrink: 0;
    width: 100px;
    padding: 14px 8px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--fg);
    background: var(--bg);
    border: 2px solid var(--fg);
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
}

.sms-resend-btn:disabled {
    color: #999;
    border-color: #DDD;
    cursor: default;
}

.sms-resend-btn:not(:disabled):active {
    background: var(--fg);
    color: var(--bg);
}

/* === Detail Info FAB & Overlay === */
.detail-fab {
    position: fixed;
    bottom: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    z-index: 100;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--fg);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 0.03em;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.detail-fab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.detail-fab:hover {
    background: var(--fg);
    border-color: var(--fg);
    color: var(--bg);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.detail-fab:hover svg {
    stroke: var(--bg);
}

.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: var(--bg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.detail-overlay[style*="display: none"],
.detail-overlay[style*="display:none"] {
    visibility: hidden;
}

.detail-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg);
    padding: 16px 24px;
    border-bottom: 2px solid var(--border);
}

.detail-back {
    background: none;
    border: 2px solid var(--border);
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 0.05em;
    cursor: pointer;
    color: var(--fg);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.detail-back:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.detail-overlay .narrative {
    margin-top: 0;
    padding: 20px 24px 60px;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 480px) {
    .detail-fab {
        bottom: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .detail-fab svg {
        width: 14px;
        height: 14px;
    }

    .detail-header {
        padding: 12px 16px;
    }

    .detail-back {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* === BPE Transition Overlay === */
.bpe-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bpe-skip {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: 2px solid var(--border);
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    color: var(--fg);
    z-index: 10001;
    transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}

.bpe-skip:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.bpe-stage {
    max-width: 560px;
    width: 100%;
    padding: 24px;
    text-align: left;
}

.bpe-step-label {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 32px;
}

.bpe-arena {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 80px;
    margin-bottom: 24px;
}

.bpe-token {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    padding: 12px 16px;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    transition: all 0.3s ease-out;
    white-space: nowrap;
}

.bpe-token.highlight {
    border-color: var(--accent);
    box-shadow: inset 0 -3px 0 var(--accent);
}

.bpe-token.merged {
    border-width: 4px;
    border-color: var(--accent);
}

.bpe-token.merged-done {
    border-width: 2px;
    border-color: var(--border);
}

.bpe-counter {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg);
    opacity: 0.7;
    margin-top: 8px;
    margin-bottom: 8px;
}

.bpe-counter em {
    color: var(--accent);
    font-style: normal;
    font-weight: 700;
}

.bpe-caption {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--fg);
    opacity: 0.5;
    line-height: 1.6;
}

.bpe-final-text {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--fg);
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.bpe-final-text.visible {
    opacity: 1;
}

/* Mock Webpage */
.mock-page {
    border: 2px solid var(--border);
    background: var(--bg);
    width: 100%;
    max-width: 480px;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.mock-page.mock-page-fade {
    opacity: 0;
    transform: scale(0.92);
}

.mock-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    background: var(--muted);
}

.mock-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mock-dot-red { background: #FF5F57; }
.mock-dot-yellow { background: #FEBC2E; }
.mock-dot-green { background: #28C840; }

.mock-url {
    margin-left: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--fg);
    opacity: 0.4;
    letter-spacing: 0.02em;
}

.mock-content {
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mock-line {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--fg);
}

.mock-placeholder {
    opacity: 0.15;
    letter-spacing: 0.1em;
}

.mock-target {
    font-weight: 700;
    color: var(--fg);
    position: relative;
    transition: color 0.3s ease-out, transform 0.6s ease-out;
    display: inline-block;
}

.mock-target-highlight {
    color: var(--accent);
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.mock-target-zoom {
    transform: scale(1.6);
    z-index: 10;
}

@media (max-width: 480px) {
    .bpe-token {
        padding: 8px 10px;
        font-size: 1.1rem;
    }

    .bpe-stage {
        padding: 16px;
    }

    .mock-page {
        max-width: 100%;
    }

    .mock-content {
        padding: 12px 10px;
    }
}

/* === Hero Animation === */
.hero-anim {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.hero-stage {
    text-align: center;
    width: 100%;
    max-width: 520px;
}

/* Phase 1: Token flash */
.hero-flash {
    font-size: clamp(1.4rem, 5vw, 2.8rem);
    font-weight: 900;
    color: var(--fg);
    opacity: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.hero-flash.slam {
    animation: hero-slam 0.2s ease-out forwards;
}

@keyframes hero-slam {
    0%   { opacity: 0; transform: scale(2); }
    50%  { opacity: 1; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

/* Tagline */
.hero-tagline {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 900;
    color: var(--fg);
    opacity: 0;
    transition: opacity 0.4s ease-out;
    letter-spacing: -0.01em;
}

.hero-tagline.visible {
    opacity: 1;
}

.hero-tagline .accent {
    color: var(--accent);
}

/* Phase 2: Memo-style annotation demo */
.hero-memo {
    text-align: left;
    max-width: 440px;
    margin: 0 auto;
    border-radius: 12px;
    background: #FFFDF7;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.hero-memo.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-memo-bar {
    padding: 10px 14px;
    display: flex;
    gap: 7px;
    align-items: center;
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.hero-memo-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.hero-memo-dot:nth-child(1) { background: #FF5F57; }
.hero-memo-dot:nth-child(2) { background: #FEBC2E; }
.hero-memo-dot:nth-child(3) { background: #28C840; }

.hero-memo-body {
    padding: 22px 24px 24px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", var(--font), sans-serif;
}

.hero-memo-line {
    margin: 0 0 10px;
    min-height: 1.8em;
}

.hero-memo-line .memo-label {
    color: var(--accent);
}

.hero-memo-line .memo-value {
    font-weight: 600;
    color: #222;
}

.hero-memo .feedback-row {
    margin-top: 18px;
    margin-bottom: 0;
    transition: opacity 0.3s ease-out;
}

.hero-start-btn {
    display: block;
    margin: 32px auto 0;
    background: var(--fg);
    color: var(--bg);
    border: 2px solid var(--fg);
    padding: 14px 48px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.4s ease-out, background 0.15s ease-out, color 0.15s ease-out;
    -webkit-appearance: none;
    appearance: none;
}
.hero-start-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

@media (max-width: 480px) {
    .hero-anim {
        padding: 16px;
    }

    .hero-memo {
        border-radius: 10px;
    }

    .hero-memo-body {
        padding: 16px 18px 20px;
        font-size: 0.88rem;
    }

    .hero-memo-btn {
        font-size: 0.84rem;
        padding: 9px 0;
    }
}

/* === Narrative Sections (Consent Page) === */
.narrative {
    margin-top: 0;
    padding-top: 40px;
}

.narrative-section {
    padding: 72px 0;
    border-top: 2px solid var(--border);
}

.narrative-title {
    font-size: clamp(1.8rem, 6vw, 3rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 24px;
    color: var(--fg);
}

.narrative-body {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    color: var(--fg);
    opacity: 0.7;
    max-width: 440px;
}

.narrative-highlight {
    color: var(--accent);
    font-weight: 700;
    opacity: 1;
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-block {
    border: 4px solid var(--border);
    padding: 28px 20px;
}

.stat-number {
    display: block;
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--fg);
    margin-bottom: 12px;
}

.stat-unit {
    font-size: 0.5em;
    color: var(--accent);
}

.stat-desc {
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--fg);
    opacity: 0.6;
}

/* Rule List */
.rule-list {
    max-width: 440px;
}

.rule-item {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--fg);
}

.rule-num {
    color: var(--accent);
    font-weight: 900;
    font-size: 0.85rem;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

/* Paper Link */
.paper-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    transition: color 0.15s ease-out;
}

.paper-link:hover {
    color: var(--accent);
}

/* Narrative Responsive */
@media (max-width: 560px) {
    .narrative-section {
        padding: 48px 0;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .narrative-title {
        font-size: clamp(1.5rem, 8vw, 2.2rem);
    }
}

/* === Label Display Module (展签风格) === */
.label-display {
    border: 3px solid var(--border);
    padding: 16px 20px;
    margin-bottom: 12px;
    text-align: left;
}

.label-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1.6;
}

.label-row + .label-row {
    margin-top: 6px;
}

.label-field {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.label-value {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--fg);
}

.label-value--bold {
    font-weight: 700;
    font-size: 0.95rem;
}

/* Info button (?) */
.info-btn {
    margin-left: auto;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--fg);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
    -webkit-tap-highlight-color: transparent;
}

.info-btn:hover,
.info-btn.active {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.info-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Info Card (definition/example) */
.info-card {
    border: 2px solid var(--border);
    padding: 20px;
    margin-bottom: 12px;
    background: var(--bg);
    animation: fadeIn 0.2s ease-out;
}

.info-card-section + .info-card-section {
    margin-top: 14px;
}

.info-card-title {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 4px;
}

.info-card-text {
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--fg);
}

/* === Feedback Row (like-button style) === */
.feedback-row {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-top: 24px;
    margin-bottom: 16px;
}

.like-button {
    position: relative;
    cursor: pointer;
    display: flex;
    height: 58px;
    border-radius: 999px;
    border: 2px solid var(--border);
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out, transform 0.15s ease-out;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.like-button:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.like-button[data-choice="agree"]:hover {
    border-color: var(--accent);
}

.like-button[data-choice="disagree"]:hover {
    border-color: var(--fg);
}

.like-button:focus-visible {
    outline: 2px solid #c0392b;
    outline-offset: 2px;
}

.like-button.disabled {
    pointer-events: none;
}

.like-button.disabled:not(.selected) {
    opacity: 0.35;
}

.like-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 28px;
    height: 100%;
    cursor: pointer;
}

.like-icon {
    fill: #333;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: fill 0.2s ease-out, transform 0.2s ease-out;
}

.like-text {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    color: #111;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Count compartment — hidden by default */
.like-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0 12px;
    height: 100%;
    border-left: 2px solid #cfcfcf;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font);
    color: #666;
    white-space: nowrap;
    transform: translateY(50px);
    transition: transform 0.4s ease-out, color 0.3s ease-out;
}

/* When count is revealed */
.like-count.visible {
    display: flex;
    transform: translateY(0);
    color: #111;
}

/* Selected states */
.like-button.selected {
    transform: none;
    box-shadow: none;
}

.like-button.selected[data-choice="agree"] {
    border-color: var(--accent);
    background: #fff;
    box-shadow: inset 0 -3px 0 var(--accent);
}

.like-button.selected[data-choice="agree"] .like-icon {
    fill: #c0392b;
    animation: icon-pop 0.25s ease-out;
}

.like-button.selected[data-choice="agree"] .like-text,
.like-button.selected[data-choice="agree"] .like-count {
    color: #111;
}

.like-button.selected[data-choice="agree"] .like-count {
    border-left-color: #efb7aa;
}

.like-button.selected[data-choice="disagree"] {
    border-color: #000;
    background: #f2f2f2;
    box-shadow: inset 0 -3px 0 #000;
}

.like-button.selected[data-choice="disagree"] .like-icon {
    fill: #000;
    animation: icon-pop 0.25s ease-out;
}

.like-button.selected[data-choice="disagree"] .like-text,
.like-button.selected[data-choice="disagree"] .like-count {
    color: #000;
}

.like-button.selected[data-choice="disagree"] .like-count {
    border-left-color: #b5b5b5;
}

@keyframes icon-pop {
    0%   { transform: scale(0.5); }
    60%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* === Progress Bar (赞同率 — EMPATHY style) === */
.progress-wrap {
    padding: 14px 0;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-out;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #999;
    letter-spacing: 0.02em;
}

.progress-value {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--fg);
}

.progress-track {
    height: 8px;
    background: #ececec;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #c0392b;
    border-radius: 4px;
    width: 0%;
    transition: width 0.8s ease-out;
}

/* === Disagree Feedback Form === */
.disagree-form {
    border: 3px solid var(--border);
    margin-bottom: 16px;
    animation: slideDown 0.25s ease-out;
    overflow: hidden;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; transform: translateY(-8px); }
    to   { opacity: 1; max-height: 500px; transform: translateY(0); }
}

.disagree-form-header {
    padding: 12px 20px;
    border-bottom: 2px solid var(--border);
    background: var(--muted);
}

.disagree-form-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg);
}

.disagree-form-body {
    padding: 16px 20px;
}

.disagree-field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 4px;
    margin-top: 12px;
}

.disagree-field-label:first-child {
    margin-top: 0;
}

.disagree-input,
.disagree-textarea {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid var(--border);
    font-size: 0.9rem;
    font-family: var(--font);
    background: transparent;
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s ease-out;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.disagree-textarea {
    resize: vertical;
}

.disagree-input:focus,
.disagree-textarea:focus {
    border-bottom-color: var(--accent);
}

.disagree-form-actions {
    display: flex;
    gap: 12px;
    padding: 12px 20px 16px;
    justify-content: flex-end;
}

.btn-disagree-skip {
    background: none;
    border: 2px solid var(--border);
    padding: 10px 24px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font);
    color: #999;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    -webkit-appearance: none;
    appearance: none;
}

.btn-disagree-skip:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.btn-disagree-submit {
    background: var(--fg);
    border: 2px solid var(--fg);
    padding: 10px 24px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font);
    color: var(--bg);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    -webkit-appearance: none;
    appearance: none;
}

.btn-disagree-submit:active {
    background: var(--accent);
    border-color: var(--accent);
}

.disagree-hint {
    color: var(--accent);
    font-size: 0.8rem;
    margin: 8px 0 0;
    text-align: center;
}

/* === Admin Dashboard === */
.admin-page {
    max-width: 640px;
    padding-bottom: 60px;
}

.admin-login-card {
    margin-top: 48px;
    border: 3px solid var(--border);
    padding: 32px 24px;
    text-align: center;
}

.admin-login-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 0;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 12px;
}

.admin-input:focus {
    border-color: var(--accent);
}

.admin-error {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.admin-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--fg);
    color: var(--bg);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.admin-btn:active {
    opacity: 0.8;
}

.admin-refresh-btn {
    display: inline-block;
    margin: 16px 0;
    padding: 8px 20px;
    border: 2px solid var(--border);
    background: var(--bg);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    -webkit-appearance: none;
}

.admin-refresh-btn:active {
    background: var(--fg);
    color: var(--bg);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.admin-stat-card {
    border: 2px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
}

.admin-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
}

.admin-section {
    margin-bottom: 32px;
}

.admin-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 12px;
}

.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    color: #999;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-variant-numeric: tabular-nums;
}

.admin-table tbody tr:hover {
    background: var(--muted);
}

.admin-export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-export-btn {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid var(--border);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg);
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    transition: background 0.15s, color 0.15s;
}

.admin-export-btn:hover {
    background: var(--fg);
    color: var(--bg);
}

.site-footer {
    padding: 24px 16px 28px;
    text-align: center;
    font-size: 12px;
    color: #777;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--fg);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .admin-stat-value {
        font-size: 1.4rem;
    }
    .admin-export-row {
        flex-direction: column;
    }
    .admin-export-btn {
        text-align: center;
    }
}

/* === Responsive === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
