:root { --green: #002fa7; --lime: #ffcf33; --ink: #10162f; --muted: #5c647c; --line: #d9ddea; --paper: #f6f7fc; --white: #fff; --error: #b3261e; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif; color: var(--ink); background: var(--paper); font-size: 18px; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { border: 0; border-radius: 0; cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
button:not(:disabled), a { transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:not(:disabled):active, .primary-button:active, .secondary-button:active { transform: translateY(2px); box-shadow: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.app-header { position: relative; z-index: 3; height: 72px; padding: 0 clamp(16px,4vw,56px); display: grid; grid-template-columns: 48px 1fr auto; align-items: center; background: var(--white); box-shadow: 0 2px 7px rgba(0,47,167,.13); }
.icon-button { display: grid; place-items: center; width: 48px; height: 48px; margin-left: -14px; background: transparent; color: var(--ink); font-size: 25px; }
.app-header #backButton[hidden] { display: grid !important; visibility: hidden; pointer-events: none; }
.app-header.no-back { grid-template-columns: minmax(0,1fr) auto; }
.app-header.no-back #backButton[hidden] { display: none !important; }
.app-title-link { min-width: 0; overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }
.step-text { padding-left: 12px; color: var(--muted); font-size: 16px; font-weight: 800; white-space: nowrap; }
.app-progress { height: 4px; background: #dfe3f0; }
.app-progress i { display: block; width: 0; height: 100%; background: var(--lime); transition: width .25s ease; }

.welcome-view { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(0,1fr) minmax(400px,.75fr); }
.welcome-copy { padding: clamp(52px,9vh,100px) clamp(28px,8vw,120px); display: flex; flex-direction: column; justify-content: center; }
.section-label { margin: 0 0 24px; color: var(--green); font-size: 15px; font-weight: 900; text-transform: uppercase; }
.welcome-copy h1 { margin: 0; font-size: clamp(58px,8vw,106px); line-height: .98; font-weight: 900; }
.welcome-copy > p:not(.section-label):not(.form-error) { max-width: 560px; margin: 28px 0 0; color: var(--muted); font-size: 20px; line-height: 1.75; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.primary-button, .secondary-button, .text-button, .danger-button { min-height: 56px; padding: 0 28px; font-size: 17px; font-weight: 800; }
.primary-button { background: var(--green); color: var(--white); box-shadow: 0 3px 8px rgba(0,47,167,.24); }
.primary-button span { margin-left: 12px; }
.secondary-button { border: 1px solid var(--green); background: transparent; color: var(--green); }
.text-button { background: transparent; color: #48516c; }
.danger-button { border: 1px solid var(--error); background: var(--error); color: var(--white); }
.welcome-poster { position: relative; min-height: 520px; padding: 34px; overflow: hidden; background: var(--green); color: var(--white); }
.poster-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 900; }
.poster-copy { position: absolute; left: 34px; bottom: 80px; font-size: clamp(42px,5vw,70px); line-height: .92; font-weight: 900; }
.poster-bottom { position: absolute; left: 34px; bottom: 34px; color: #dce4ff; font-size: 14px; font-weight: 800; }

.resume-form { max-width: 520px; margin-top: 35px; padding-top: 28px; border-top: 1px solid var(--line); }
.resume-form h2 { margin: 0 0 24px; font-size: 28px; }
.resume-form label, .field-label { display: grid; gap: 10px; margin-bottom: 22px; color: var(--muted); font-size: 16px; font-weight: 800; }
.resume-form input, .line-input, textarea, select { width: 100%; height: 62px; padding: 0 16px; border: 0; border-bottom: 2px solid #aeb8b2; border-radius: 0; outline: 0; background: var(--white); color: var(--ink); font-size: 20px; }
textarea { height: auto; padding-block: 15px; resize: vertical; line-height: 1.7; }
select { cursor: pointer; }
.resume-form input:focus, .line-input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 2px 0 var(--green); }
.inline-actions { display: flex; gap: 10px; }
.form-error { min-height: 24px; margin: 16px 0 0; color: var(--error); font-size: 16px; font-weight: 700; }

.question-view { min-height: calc(100vh - 164px); display: grid; place-items: center; padding: 42px 24px; }
.question-shell { width: min(820px,100%); }
.question-heading { display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: start; }
.question-number { padding-top: 7px; color: var(--green); font-size: 22px; font-weight: 900; }
.question-heading h1 { margin: 0; font-size: clamp(38px,4.7vw,58px); line-height: 1.24; font-weight: 900; }
.question-description { margin: 16px 0 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.question-form { margin: 38px 0 0 74px; }
.question-form .field-label > span { font-size: 16px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.phone-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.region-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.option-list { display: grid; gap: 10px; }
.choice { position: relative; min-height: 66px; padding: 15px 18px; display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: center; border: 1px solid #c9d1cc; background: var(--white); cursor: pointer; font-size: 18px; line-height: 1.55; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.choice:hover { border-color: var(--green); }
.choice:active { transform: translateX(3px); }
.choice:has(input:checked) { border: 2px solid var(--green); padding: 14px 17px; background: #eef2ff; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-key { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #aab5af; color: var(--muted); font-size: 14px; font-weight: 900; }
.choice:has(input:checked) .choice-key { border-color: var(--green); background: var(--green); color: var(--white); }
.other-field { margin-top: 20px; }

.id-grid { display: grid; grid-template-columns: repeat(18,minmax(24px,1fr)); gap: 5px; }
.id-grid input { min-width: 0; height: 60px; padding: 0; border: 0; border-bottom: 2px solid #aeb8b2; border-radius: 0; outline: 0; background: var(--white); text-align: center; font-size: 21px; font-weight: 800; }
.id-grid input:focus { border-color: var(--green); background: #eef2ff; }

.range-control { --track-active: var(--green); --track-rest: #d9ddea; }
.range-control output { display: block; margin-bottom: 12px; color: var(--green); font-size: 88px; line-height: 1; font-weight: 900; }
input[type="range"] { width: 100%; height: 44px; margin: 0; padding: 0; appearance: none; border: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(to right,var(--track-active) 0 var(--value),var(--track-rest) var(--value) 100%); }
input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -10px; appearance: none; border: 0; border-radius: 0; background: var(--lime); box-shadow: 0 2px 5px rgba(0,0,0,.22); }
input[type="range"]::-moz-range-track { height: 6px; background: var(--track-rest); }
input[type="range"]::-moz-range-progress { height: 6px; background: var(--track-active); }
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 0; background: var(--lime); }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; }

.question-actions { min-height: 88px; padding: 0 clamp(24px,6vw,88px); display: flex; align-items: center; justify-content: flex-end; gap: 24px; border-top: 1px solid var(--line); background: var(--white); }
.question-actions > span { color: var(--muted); font-size: 14px; }

.finish-view { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 40px 24px; text-align: center; }
.finish-view section { max-width: 720px; }
.finish-mark { display: grid; place-items: center; width: 82px; height: 82px; margin: 0 auto 30px; background: var(--lime); color: var(--ink); font-size: 38px; font-weight: 900; }
.finish-view h1 { margin: 0; font-size: clamp(48px,8vw,86px); line-height: 1; }
.finish-view p:not(.section-label) { margin: 24px 0 12px; color: var(--muted); font-size: 20px; }
.finish-view strong { display: block; margin-bottom: 34px; }

.setup-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.setup-panel { width: min(560px,100%); padding: 40px; border: 1px solid var(--line); background: var(--white); box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.setup-panel h1 { margin: 24px 0 10px; }
.setup-panel p { color: var(--muted); }
.setup-panel code { padding: 2px 5px; background: #eef1f8; }
.notice { margin: 20px 0; padding: 14px; font-size: 16px; }

.welcome-copy > *, .welcome-poster { animation: rise-in .55s cubic-bezier(.2,.7,.2,1) both; }
.welcome-copy > *:nth-child(2) { animation-delay: .05s; }
.welcome-copy > *:nth-child(3) { animation-delay: .1s; }
.welcome-copy > *:nth-child(4), .welcome-copy > *:nth-child(5) { animation-delay: .15s; }
.question-enter { animation: question-in .38s cubic-bezier(.2,.75,.25,1) both; }
.score-pop { animation: score-pop .22s ease-out; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes question-in { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: translateX(0); } }
@keyframes score-pop { 50% { transform: scale(1.07); } }
.notice.success { background: #e2f2e8; color: #165c3b; }
.notice.error { background: #f9e4e2; color: var(--error); }

.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef1f8; }
.login-panel { width: min(460px,100%); padding: 44px; border: 1px solid var(--line); background: var(--white); box-shadow: 0 4px 12px rgba(0,47,167,.13); }
.login-panel .section-label { margin: 24px 0 8px; }
.login-panel h1 { margin: 0 0 30px; font-size: 38px; }
.login-panel .primary-button { width: 100%; margin-top: 8px; }
.admin-page { background: #f4f6fb; }
.admin-header { min-height: 68px; padding: 0 clamp(20px,4vw,60px); display: flex; align-items: center; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); background: var(--white); }
.admin-name { font-size: 20px; font-weight: 900; white-space: nowrap; }
.admin-header nav { display: flex; align-items: center; gap: 28px; font-size: 16px; font-weight: 800; }
.admin-header nav a:hover { color: var(--green); }
.admin-main { max-width: 1320px; margin: 0 auto; padding: 48px clamp(20px,4vw,60px) 70px; }
.admin-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.admin-title .section-label { margin-bottom: 10px; }
.admin-title h1 { margin: 0; font-size: clamp(36px,5vw,58px); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); border: 1px solid var(--line); background: var(--white); }
.stat-grid article { min-height: 170px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.stat-grid article:last-child { border-right: 0; }
.stat-grid span { color: var(--muted); font-size: 16px; font-weight: 800; }
.stat-grid b { color: var(--green); font-size: 58px; line-height: 1; }
.admin-section { margin-top: 42px; }
.admin-section h2 { font-size: 20px; }
.quick-links { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); background: var(--white); }
.quick-links a { min-height: 86px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-right: 1px solid var(--line); font-size: 17px; font-weight: 800; }
.quick-links a:last-child { border-right: 0; }
.quick-links a:hover { background: #eef2ff; color: var(--green); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th { padding: 15px 18px; background: #e8ecf7; color: #48516c; text-align: left; font-size: 14px; }
td { padding: 17px 18px; border-top: 1px solid #e2e7e3; vertical-align: middle; }
td small { display: block; margin-top: 5px; color: var(--muted); }
.status { display: inline-block; padding: 6px 9px; background: #e4e7e4; color: #626b66; font-size: 13px; font-weight: 900; }
.status.active { background: #d9efe3; color: #166443; }
.status.deleted { background: #f9e4e2; color: var(--error); }
.row-actions { white-space: nowrap; }
.row-actions a, .link-button { padding: 0 8px; background: transparent; color: var(--green); font-weight: 800; }
.row-actions form { display: inline; }
.editor-form { max-width: 820px; padding: 34px; border: 1px solid var(--line); background: var(--white); }
.editor-grid { display: grid; grid-template-columns: 1fr 180px; gap: 20px; }
.check-line { display: block; margin: 18px 0 28px; font-size: 16px; font-weight: 800; }
.check-line input { margin-right: 8px; accent-color: var(--green); }
.filter-tabs { display: flex; gap: 0; margin-bottom: 18px; }
.filter-tabs a { padding: 12px 20px; border-bottom: 2px solid #bec7c1; color: var(--muted); font-size: 15px; font-weight: 800; }
.filter-tabs a.selected { border-color: var(--green); color: var(--green); }
.check-cell { width: 48px; text-align: center; }
.check-cell input, .check-line input { width: 18px; height: 18px; accent-color: var(--green); }
.empty-row { padding: 48px; color: var(--muted); text-align: center; }
.bulk-actions { margin-top: 16px; padding: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; border: 1px solid var(--line); background: var(--white); }
.bulk-actions > span { margin-right: auto; font-weight: 800; }
.bulk-actions select { width: 190px; height: 56px; }
.response-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 24px; color: var(--muted); font-size: 15px; font-weight: 800; }
.answer-list { border: 1px solid var(--line); background: var(--white); }
.answer-list article { padding: 24px; border-bottom: 1px solid var(--line); }
.answer-list article:last-child { border-bottom: 0; }
.answer-list h2 { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.answer-list p { margin: 0; font-size: 18px; line-height: 1.7; }
.detail-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 12px; }

@media (max-width: 850px) {
  .welcome-view { grid-template-columns: 1fr; }
  .welcome-poster { min-height: 420px; }
}
@media (max-width: 620px) {
  body { font-size: 18px; }
  .app-header { position: sticky; top: 0; height: 68px; padding-inline: 14px; grid-template-columns: 44px minmax(0,1fr) auto; }
  .icon-button { width: 44px; height: 48px; margin-left: -10px; }
  .app-title-link { font-size: 15px; }
  .step-text { padding-left: 8px; font-size: 14px; }
  .welcome-copy { padding: 42px 20px 48px; }
  .section-label { margin-bottom: 18px; font-size: 14px; }
  .welcome-copy h1 { font-size: clamp(54px,18vw,76px); }
  .welcome-copy > p:not(.section-label):not(.form-error) { margin-top: 24px; font-size: 19px; line-height: 1.65; }
  .welcome-meta { gap: 18px; font-size: 15px; }
  .welcome-actions { display: grid; }
  .welcome-actions button { width: 100%; }
  .primary-button, .secondary-button, .text-button, .danger-button { min-height: 58px; font-size: 18px; }
  .welcome-poster { min-height: 290px; padding: 24px; }
  .poster-copy { font-size: 46px; }
  .poster-copy { left: 24px; bottom: 62px; }
  .poster-bottom { left: 24px; bottom: 24px; }
  .question-view { min-height: calc(100vh - 148px); padding: 28px 18px 34px; align-items: start; overflow-x: hidden; }
  .question-heading { grid-template-columns: 1fr; gap: 7px; }
  .question-number { padding: 0; font-size: 20px; }
  .question-heading h1 { font-size: clamp(34px,10vw,46px); line-height: 1.22; overflow-wrap: break-word; }
  .question-description { font-size: 18px; line-height: 1.65; }
  .question-form { margin: 28px 0 0; }
  .resume-form input, .line-input, textarea, select { height: 62px; font-size: 20px; }
  textarea { height: auto; }
  .two-fields, .phone-fields, .region-fields { grid-template-columns: 1fr; gap: 2px; }
  .choice { min-height: 70px; padding: 16px; grid-template-columns: 34px 1fr; font-size: 18px; }
  .choice:has(input:checked) { padding: 15px; }
  .id-grid { grid-template-columns: repeat(6,1fr); gap: 8px 5px; }
  .id-grid input { height: 52px; font-size: 20px; }
  .range-control output { font-size: 96px; }
  input[type="range"] { height: 54px; }
  .range-labels { font-size: 14px; }
  .question-actions { position: sticky; bottom: 0; z-index: 4; min-height: 80px; padding: 10px 14px; gap: 10px; box-shadow: 0 -3px 10px rgba(0,47,167,.1); }
  .question-actions > span { margin-right: auto; font-size: 13px; }
  .question-actions .primary-button { min-width: 132px; padding-inline: 16px; }
  .admin-header { padding: 12px 16px; align-items: flex-start; flex-direction: column; }
  .admin-header nav { width: 100%; gap: 0; overflow-x: auto; }
  .admin-header nav a { padding: 10px 18px 10px 0; white-space: nowrap; }
  .admin-main { padding: 32px 16px 50px; }
  .admin-title { align-items: flex-start; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid article { min-height: 130px; border-bottom: 1px solid #c9d1cc; }
  .stat-grid article:nth-child(2) { border-right: 0; }
  .stat-grid b { font-size: 44px; }
  .quick-links { grid-template-columns: 1fr; }
  .quick-links a { border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-form, .login-panel { padding: 24px; }
  .editor-grid { grid-template-columns: 1fr; gap: 0; }
  .bulk-actions { align-items: stretch; flex-direction: column; }
  .bulk-actions > span { margin: 0; }
  .bulk-actions select, .bulk-actions button { width: 100%; }
  .detail-actions { align-items: stretch; flex-direction: column; }
}
@media (max-width: 360px) {
  .app-title-link { font-size: 14px; }
  .step-text { font-size: 13px; }
  .question-actions > span { display: none; }
  .question-actions .primary-button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
