:root {
    --nhk-red: #ff4d4f;
    --nhk-red-dark: #c9282d;
    --nhk-orange: #ff9800;
    --nhk-ink: #2c2927;
    --nhk-muted: #7c706b;
    --nhk-line: #eeeeee;
    --nhk-canvas: #f1f1f1;
    --nhk-surface: #ffffff;
    --nhk-preview-height: 230px;
}

* { box-sizing: border-box; }

html { background: var(--nhk-canvas); }

body {
    min-width: 320px;
    margin: 0;
    background: var(--nhk-canvas);
    color: var(--nhk-ink);
    font: 14px/1.45 "Microsoft YaHei", Arial, sans-serif;
}

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

.nhk-app-shell {
    width: min(100%, 640px);
    min-height: 100vh;
    margin: 0 auto;
    padding-top: var(--nhk-preview-height);
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.nhk-theme-preview {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 1000;
    width: 100%;
    max-width: 640px;
    padding: 10px 8px;
    transform: translateX(-50%);
    border-bottom: 1px solid #eee;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.nhk-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.nhk-preview-item {
    min-width: 0;
    min-height: 30px;
    padding: 5px 2px;
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    background: var(--nhk-orange);
    color: #fff;
    font: 500 14px/1.15 "Microsoft YaHei", Arial, sans-serif;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: filter .2s, transform .2s, background .2s;
}

.nhk-preview-item.is-active {
    background: var(--nhk-red);
}

.nhk-preview-item:hover { filter: brightness(.92); }
.nhk-preview-item:active { transform: scale(.95); }

main { padding: 8px 6px; }

.nhk-draw-card,
.nhk-data-frame-wrap {
    overflow: hidden;
    border-radius: 6px;
    background: var(--nhk-surface);
}

.nhk-draw-card {
    margin-bottom: 10px;
    border: 1px solid var(--nhk-line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.nhk-draw-card iframe {
    display: block;
    width: 100%;
    height: 232px;
    border: 0;
}

.nhk-data-frame-wrap {
    overflow: visible;
    border-radius: 0;
    background: transparent;
}

.nhk-data-frame {
    display: none;
    width: 100%;
    min-height: 1000px;
    border: 0;
    background: #fff;
}

.nhk-data-frame.is-active { display: block; }

@media (max-width: 430px) {
    :root { --nhk-preview-height: 196px; }
    .nhk-theme-preview { padding: 8px 6px; }
    .nhk-preview-grid { gap: 4px; }
    .nhk-preview-item {
        min-height: 26px;
        padding: 4px 1px;
        border-radius: 14px;
        font-size: 12.6px;
    }
    main { padding: 6px; }
    .nhk-draw-card iframe { height: 218px; }
}
