:root {
    --bg: #f7f7f8;
    --surface: #ffffff;
    --text: #1d1d1f;
    --muted: #6b6b73;
    --border: #e3e3e8;
    --primary: #e94560;
    --primary-hover: #d63a54;
    --success-bg: #e8f6ee;
    --success-text: #1e6b3c;
    --error-bg: #fdecee;
    --error-text: #a3253a;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #151518;
        --surface: #1f1f24;
        --text: #ececf0;
        --muted: #9a9aa5;
        --border: #33333b;
        --success-bg: #183324;
        --success-text: #8fd6a9;
        --error-bg: #3a1a20;
        --error-text: #f2a3b0;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--primary); }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 32px; padding-bottom: 48px; }

/* header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.nav a { color: var(--text); text-decoration: none; }
.nav a.btn { color: #fff; }
.inline { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; }

.site-footer { border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.footer-inner a { color: var(--muted); }

/* components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card.narrow { max-width: 440px; margin: 0 auto; }
.card h1 { font-size: 22px; margin-top: 0; }
.center { text-align: center; }

.btn {
    display: inline-block; background: var(--primary); color: #fff; border: 0;
    border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600;
    text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-small { padding: 4px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.input {
    width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.help ul { margin: 4px 0; padding-left: 18px; }
.form-error { color: var(--error-text); font-size: 13px; margin-top: 4px; }

.messages { list-style: none; padding: 0; margin: 0 0 24px; }
.message { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.message-success, .message-info { background: var(--success-bg); color: var(--success-text); }
.message-error, .message-warning { background: var(--error-bg); color: var(--error-text); }
.notice { background: var(--error-bg); color: var(--error-text); padding: 10px 12px; border-radius: 8px; font-size: 13px; }

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

/* home */
.hero { text-align: center; padding: 48px 0; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); margin: 0 0 8px; }
.url-form { display: flex; gap: 8px; max-width: 640px; margin: 24px auto 8px; }
.url-form .input { flex: 1; }
@media (max-width: 560px) { .url-form { flex-direction: column; } }

/* settings */
.settings { max-width: 560px; margin: 0 auto; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tabs a { padding: 6px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.tabs a.active { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

.error-code { font-size: 56px; font-weight: 800; color: var(--primary); line-height: 1; }
.prose { max-width: 760px; margin: 0 auto; }

/* ===== 共通（追加） ===== */
:root { --high: #1f9d55; --mid: #d69e2e; --low: #e53e3e; --track: #ececf1; }
@media (prefers-color-scheme: dark) { :root { --track: #2c2c33; } }
h1 { font-size: 26px; line-height: 1.4; }
h2 { font-size: 20px; margin-top: 32px; }
.h3 { font-size: 17px; margin-top: 0; }
.sp-only { display: none; }
@media (max-width: 560px) { .sp-only { display: inline; } h1 { font-size: 22px; } }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--low); }
.link-button.danger, .danger { color: var(--low); }
.input-short { width: auto; min-width: 120px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--track); color: var(--muted); }
.badge-open { background: var(--success-bg); color: var(--success-text); }
.badge-warn { background: var(--error-bg); color: var(--error-text); }
.notice-box { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); padding: 10px 14px; border-radius: 8px; margin: 16px 0; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.actions form { margin: 0; }
.field ul { list-style: none; padding: 0; margin: 4px 0; }
.field li label { font-weight: normal; display: flex; gap: 6px; align-items: center; }
.pagination { display: flex; gap: 16px; justify-content: center; margin: 24px 0; }
section.card { margin-top: 16px; }

/* header menu */
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 0; min-width: 160px; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.menu-body a, .menu-body .link-button { display: block; padding: 6px 16px; width: 100%; text-align: left; color: var(--text); }
.menu-body form { margin: 0; }
@media (max-width: 560px) { .nav { gap: 10px; font-size: 13px; } }

/* home */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0 32px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.step h3 { margin: 4px 0; font-size: 16px; }
.step p { margin: 0; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.cf-turnstile { display: flex; justify-content: center; margin: 8px 0; }

/* cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.request-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); }
.request-card:hover { border-color: var(--primary); }
.request-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--track); }
.request-card-body { padding: 10px 12px; }
.request-card-title { font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* lists */
.list { list-style: none; padding: 0; margin: 0; }
.list-item { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; }
.list-thumb img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; display: block; }
.list-body { flex: 1; min-width: 0; }
.list-title { font-weight: 600; color: var(--text); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-body p { margin: 4px 0 0; }
.count { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) { .list-thumb img { width: 88px; } }

/* job */
.job-thumb { width: 100%; max-width: 320px; border-radius: 8px; }
.job-title { font-size: 17px; }
.spinner { width: 40px; height: 40px; margin: 16px auto; border: 4px solid var(--track); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* result */
.video-head { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; margin-bottom: 16px; }
.video-thumb { width: 100%; border-radius: 8px; display: block; }
.video-title { font-size: 22px; margin: 0 0 4px; }
@media (max-width: 720px) { .video-head { grid-template-columns: 1fr; } }
.video-mini { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.video-mini img { width: 120px; border-radius: 6px; }

.report-summary { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; }
@media (max-width: 560px) { .report-summary { grid-template-columns: 1fr; text-align: center; } }
.overall { width: 112px; height: 112px; border-radius: 50%; border: 6px solid currentColor; display: grid; place-content: center; text-align: center; margin: 0 auto; }
.overall-score { font-size: 38px; font-weight: 800; line-height: 1; }
.bars { list-style: none; padding: 0; margin: 8px 0 0; text-align: left; }
.bars li { display: grid; grid-template-columns: 9em 1fr 2.5em; gap: 8px; align-items: center; font-size: 13px; margin: 6px 0; }
.bar { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: currentColor; }
.bar-value { text-align: right; font-weight: 600; }
.score-high { color: var(--high); } .score-mid { color: var(--mid); } .score-low { color: var(--low); }
.score-pill { display: inline-block; min-width: 2.4em; text-align: center; font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1.5px solid currentColor; }
.strengths ul { margin: 4px 0; }
.analysis-meta { margin: 16px 0 0; }

.category h2 { display: flex; align-items: center; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.item summary { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; }
.item-title { font-weight: 600; }
.item-summary { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .item summary { grid-template-columns: auto 1fr; } .item-summary { grid-column: 1 / -1; white-space: normal; } }
.item-body { padding: 0 14px 12px; border-top: 1px solid var(--border); }
.improvement { background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.improvement p { margin: 4px 0 0; }
.timestamps a { margin-right: 8px; }

/* request */
.video-embed { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.request-head h1 { margin: 8px 0; }
.question { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.opinion-form { margin-bottom: 8px; }
.opinion { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; }
.opinion-hidden { opacity: .6; border-style: dashed; }
.opinion-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.opinion-body { margin: 6px 0; overflow-wrap: anywhere; }
.ts { font-weight: 600; text-decoration: none; }
.report summary { cursor: pointer; display: inline; }
.report-form { display: flex; gap: 6px; margin-top: 6px; }
.moderate { display: flex; gap: 6px; flex-wrap: wrap; }
.share { display: flex; gap: 8px; }
.danger-zone { margin-top: 32px; text-align: right; }
