/* 访谈室 —— 极简黑白（参照 yikipedia.cn） */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink: #111111;
    --ink-soft: #555555;
    --ink-faint: #999999;
    --line: #e4e4e4;
    --bg: #ffffff;
    --card: #ffffff;
    --gray: #f5f5f5;
    --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", "Noto Serif CJK SC", serif;
    --sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 页眉页脚 ---------- */
.site-header {
    padding: 34px 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}
.site-title {
    font-family: var(--serif);
    font-size: 26px;
    letter-spacing: 8px;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.site-logo {
    width: 30px;
    height: 30px;
    vertical-align: middle;
}
.site-sub {
    display: block;
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--ink-faint);
    margin-top: 6px;
    text-transform: uppercase;
}
.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--ink-faint);
    font-size: 12px;
    letter-spacing: 1px;
    border-top: 1px solid var(--line);
    margin-top: auto;
}
.footer-slogan { margin-bottom: 6px; }
.footer-beian a {
    color: var(--ink-faint);
    text-decoration: none;
}
.footer-beian a:hover { color: var(--ink); text-decoration: underline; }
.beian-sep { margin: 0 8px; }
.beian-icon {
    height: 14px;
    vertical-align: -2px;
    margin-right: 4px;
}

/* ---------- 布局 ---------- */
.container {
    width: 100%;
    max-width: 720px;
    margin: 48px auto;
    padding: 0 20px;
    flex: 1;
}
/* 邀请页：验证码 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .form-input { flex: 1; }
.captcha-row img {
    border: 1px solid var(--line);
    border-radius: 2px;
    cursor: pointer;
    height: 48px;
    flex-shrink: 0;
}

/* 聊天页：拉满宽度，减少两侧空白 */
.container-wide {
    width: 100%;
    max-width: 1120px;
    margin: 20px auto;
    padding: 0 14px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 44px 48px;
}
.card-narrow { max-width: 420px; margin: 0 auto; }

.page-title {
    font-family: var(--serif);
    font-size: 28px;
    font-weight: normal;
    letter-spacing: 4px;
    margin-bottom: 16px;
}
.page-desc {
    color: var(--ink-soft);
    font-size: 15px;
    margin-bottom: 24px;
}

/* ---------- 表单 ---------- */
.form-label {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
    margin: 20px 0 6px;
    letter-spacing: 1px;
}
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 2px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s;
}
.form-input:focus {
    outline: none;
    border-color: var(--ink);
}
.btn {
    display: inline-block;
    border: 1px solid var(--ink);
    border-radius: 2px;
    padding: 12px 28px;
    font-size: 14px;
    letter-spacing: 4px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s, opacity .15s;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary {
    background: var(--ink);
    color: #fff;
    margin-top: 28px;
    width: 100%;
}
.btn-primary:hover:not(:disabled) { background: #333; }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
    padding: 8px 18px;
    font-size: 13px;
    letter-spacing: 2px;
    margin-top: 0;
}
.btn-ghost:hover:not(:disabled) { background: var(--gray); }

.alert-error {
    background: var(--gray);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 2px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ---------- 风格选择 ---------- */
.style-options { margin: 8px 0 4px; }
.style-option {
    display: block;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 18px 22px;
    margin-bottom: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.style-option:hover { border-color: var(--ink); }
.style-option input { display: none; }
.style-option:has(input:checked) {
    border-color: var(--ink);
    background: var(--gray);
}
.style-quote {
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.9;
    color: var(--ink);
}

/* ---------- 聊天 ---------- */
/* 两栏：左对话、右前景提要 */
.chat-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-rows: minmax(0, 1fr);
    gap: 14px;
    flex: 1;
    min-height: 0;
}
.chat-layout .chat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    padding: 20px 24px;
}
.chat-brief {
    overflow-y: auto;
    padding: 22px 24px;
    height: 100%;
}
.brief-title {
    font-family: var(--serif);
    font-size: 19px;
    font-weight: normal;
    letter-spacing: 3px;
    margin-bottom: 12px;
}
.brief-intro {
    color: var(--ink-soft);
    font-size: 13.5px;
    line-height: 1.8;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.brief-body { font-size: 13.5px; line-height: 1.9; color: var(--ink); }
.brief-body p { margin-bottom: 10px; }
.brief-progress {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-soft);
}
.chat-card .chat-box { padding: 16px 14px; }
.chat-card .msg { max-width: 72%; }
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.chat-title { font-family: var(--serif); font-size: 22px; font-weight: normal; letter-spacing: 2px; }
.chat-sub { color: var(--ink-faint); font-size: 12px; margin-top: 4px; letter-spacing: 1px; }

.chat-box {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 16px;
    background: var(--gray);
    border-radius: 2px;
}
.chat-loading { color: var(--ink-faint); font-size: 13px; text-align: center; padding: 20px; }

.msg { margin-bottom: 20px; max-width: 80%; }
.msg-ai { margin-right: auto; }
.msg-me { margin-left: auto; text-align: right; }
.msg-bubble {
    display: inline-block;
    text-align: left;
    padding: 12px 16px;
    border-radius: 2px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 15px;
    line-height: 1.8;
}
.msg-ai .msg-bubble {
    background: var(--gray);
}
.msg-me .msg-bubble {
    background: #fff;
    border: 1px solid var(--line);
}
.msg-meta { font-size: 11px; color: var(--ink-faint); margin-top: 4px; letter-spacing: 1px; }

.chat-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}
.chat-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.7;
}
.chat-input:focus { outline: none; border-color: var(--ink); }
.chat-form .btn-primary { width: auto; margin-top: 0; letter-spacing: 2px; padding: 10px 24px; }
.chat-actions { display: flex; gap: 10px; }
.chat-notice { color: var(--ink-soft); font-size: 13px; margin-top: 10px; min-height: 20px; }

/* ---------- AI 访谈小结 ---------- */
.summary-card {
    border: 1px solid var(--line);
    background: var(--gray);
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 14px;
}
.summary-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.summary-title {
    font-family: var(--serif);
    font-size: 17px;
    letter-spacing: 2px;
    color: var(--ink);
}
.summary-badge {
    font-size: 11px;
    color: var(--ink-faint);
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 1px 10px;
    letter-spacing: 1px;
}
.summary-body {
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.9;
    white-space: pre-wrap;
}

/* ---------- 量表填写页 ---------- */
.survey-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}
.survey-questions { margin: 18px 0 6px; padding-left: 0; list-style: none; }
.survey-question {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}
.survey-q-text { font-size: 15px; margin-bottom: 12px; line-height: 1.8; }
.survey-required { color: #b3392f; margin-left: 4px; }
.scale-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.scale-label { font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.scale-options { display: flex; gap: 8px; flex: 1; justify-content: space-between; }
.scale-option { position: relative; cursor: pointer; }
.scale-option input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}
.scale-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 15px;
    color: var(--ink-soft);
    background: #fff;
    transition: all .15s ease;
}
.scale-option:hover .scale-num { border-color: var(--ink); color: var(--ink); }
.scale-option input:checked + .scale-num {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.scale-option input:focus-visible + .scale-num { outline: 2px solid var(--ink-soft); outline-offset: 2px; }

@media (max-width: 900px) {
    .survey-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .chat-layout { grid-template-columns: 1fr; grid-template-rows: auto; flex: none; height: auto; }
    .chat-layout .chat-card { height: calc(100dvh - 260px); }
    .chat-brief { height: auto; max-height: 240px; order: -1; }
}
@media (max-width: 600px) {
    .card { padding: 28px 22px; }
    .chat-layout .chat-card { height: calc(100dvh - 220px); padding: 14px 12px; }
    .chat-header { flex-wrap: wrap; gap: 8px; }
    .chat-title { font-size: 19px; }
    .msg { max-width: 92%; }
}
