:root {
  --ink: #19333a;
  --muted: #65777b;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-soft: #e7f6f3;
  --line: #d9e5e5;
  --paper: #ffffff;
  --canvas: #f4f8f7;
  --shadow: 0 10px 28px rgba(25, 51, 58, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
body { -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) max(16px, 4vw) 14px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--teal); color: white; font-weight: 800; font-size: 20px; }
.brand-copy { min-width: 0; flex: 1; }
.brand-copy h1 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eyebrow { margin: 0 0 2px; color: var(--teal); font-size: 11px; letter-spacing: .12em; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; padding: 6px; }
.app-main { width: min(1120px, 100%); margin: 0 auto; padding: 22px max(16px, 4vw) 44px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(20px, 4vw, 36px); }
.hero { display: grid; gap: 22px; min-height: min(650px, calc(100vh - 110px)); align-content: center; }
.hero h2, .panel h2 { margin: 0; font-size: clamp(26px, 5vw, 42px); line-height: 1.2; letter-spacing: -.02em; }
.hero p, .panel-intro { color: var(--muted); line-height: 1.75; margin: 0; }
.hero-actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.intro-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.intro-stats span { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfb; color: var(--muted); font-size: 13px; }
.intro-stats b { color: var(--teal-dark); }
.button { min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:active { transform: translateY(1px); }
.button-primary { color: white; background: var(--teal); box-shadow: 0 6px 16px rgba(15,118,110,.2); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { background: white; border-color: var(--line); color: var(--ink); }
.button-quiet { background: var(--teal-soft); color: var(--teal-dark); }
.progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.progress-track { height: 7px; flex: 1; overflow: hidden; border-radius: 20px; background: #e9efef; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--teal); transition: width .25s ease; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 26px 0; }
.field { display: grid; gap: 8px; }
.field label, .question-label { font-weight: 700; }
.required { color: #c2413d; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; color: var(--ink); background: #fbfdfd; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
.sort-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; margin-bottom: 18px; }
.sort-head h2 { font-size: clamp(22px, 4vw, 32px); }
.counter { flex: none; color: var(--teal-dark); background: var(--teal-soft); padding: 8px 11px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.sort-help { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 16px; }
.rough-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.rough-source { min-height: 170px; }
.rough-zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.drop-zone { min-height: 145px; padding: 11px; border: 2px dashed var(--line); border-radius: 14px; background: #fbfdfd; transition: border-color .15s, background .15s, transform .15s; }
.drop-zone.is-over { border-color: var(--teal); background: var(--teal-soft); transform: scale(1.01); }
.drop-zone h3 { margin: 0 0 8px; font-size: 14px; }
.zone-meta { color: var(--muted); font-size: 12px; }
.card-list { display: grid; gap: 9px; align-content: start; }
.card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; width: 100%; padding: 0; border: 1px solid #d6e4e3; border-radius: 12px; background: white; color: var(--ink); text-align: left; line-height: 1.55; box-shadow: 0 3px 9px rgba(25,51,58,.05); touch-action: none; user-select: none; }
.card:has(.card-select:active), .card.is-selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.14); }
.card-select { min-width: 0; padding: 13px 4px 13px 14px; border: 0; border-radius: 12px 0 0 12px; background: transparent; color: var(--ink); text-align: left; line-height: inherit; touch-action: manipulation; }
.drag-handle { border: 0; border-left: 1px solid var(--line); border-radius: 0 12px 12px 0; background: #f4f8f7; color: var(--teal); font-size: 20px; touch-action: none; }
.card.is-dragging { opacity: .58; cursor: grabbing; }
.card-id { display: inline-grid; place-items: center; min-width: 24px; height: 22px; margin-right: 6px; border-radius: 7px; background: var(--teal-soft); color: var(--teal-dark); font-size: 12px; font-weight: 800; vertical-align: top; }
.sort-grid-wrap { overflow-x: auto; padding-bottom: 8px; }
.sort-head { margin-bottom: 12px; }
.score-dock { position: sticky; top: 72px; z-index: 10; margin: 0 -4px 16px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 6px 18px rgba(25,51,58,.08); }
.scale-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.score-targets { display: grid; grid-template-columns: repeat(9, minmax(36px, 1fr)); gap: 4px; }
.score-target { min-height: 46px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.score-target.active { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 2px rgba(15,118,110,.12); }
.score-target.full { opacity: .65; }
.score-target b, .score-target small { display: block; }
.score-target small { color: var(--muted); font-size: 10px; }
.selection-note { min-height: 18px; margin-top: 7px; color: var(--muted); font-size: 12px; text-align: center; }
.sort-workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 14px; }
.pool-section, .column-detail { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfd; }
.column-detail.is-over, .pool-section.is-over { border-color: var(--teal); background: var(--teal-soft); }
.section-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.section-heading h3 { margin: 0 0 10px; }
.section-heading small { color: var(--muted); font-size: 12px; font-weight: 400; }
.filter-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-tabs button, .pagination button { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); padding: 7px 8px; font-size: 12px; }
.filter-tabs button.active { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-soft); }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.empty-slot { width: 100%; margin-top: 10px; padding: 11px; border: 1px dashed var(--line); border-radius: 9px; background: white; color: var(--muted); }
.draft-tools { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin: 12px 4px 0; color: var(--muted); font-size: 12px; }
.rough-current { max-width: 650px; margin: 10px auto 16px; }
.rough-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.rough-target { min-height: 80px; border: 2px dashed var(--line); border-radius: 13px; background: #fff; color: var(--ink); }
.rough-target b, .rough-target small { display: block; }
.rough-target small { margin-top: 6px; color: var(--muted); }
.rough-target.positive { background: #f0fbf5; }
.rough-target.negative { background: #fff4f5; }
.rough-target.neutral { background: #f7f8fa; }
.rough-target.is-over, [data-drop].is-over { border-color: var(--teal); background: var(--teal-soft); }
.rough-review { margin-top: 18px; }
.rough-review h3 { margin-top: 18px; }
.review-list { display: grid; gap: 12px; margin: 22px 0; }
.review-column { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfd; }
.review-column h3 { margin: 0 0 8px; color: var(--teal-dark); }
.review-column h3 small { color: var(--muted); font-size: 12px; font-weight: 400; }
.review-item { padding: 10px 0; border-top: 1px solid var(--line); }
.review-item p { margin: 0 0 8px; line-height: 1.55; }
.review-item .field { max-width: 720px; }
.drag-ghost { position: fixed; z-index: 100; width: min(240px, 70vw); max-height: 100px; overflow: hidden; padding: 10px; border: 2px solid var(--teal); border-radius: 10px; background: #fff; box-shadow: var(--shadow); pointer-events: none; font-size: 12px; line-height: 1.4; }
.file-label { display: inline-block; margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.file-label input { display: block; margin-top: 7px; }
.question { border: 0; padding: 0; min-inline-size: 0; }
.question legend { margin-bottom: 9px; padding: 0; font-weight: 700; }
#form-error { margin: 16px 0; color: #b42318; font-weight: 700; }
.sort-grid { display: grid; grid-template-columns: repeat(9, minmax(118px, 1fr)); gap: 8px; min-width: 1080px; align-items: start; }
.sort-column { min-height: 300px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fbfdfd; }
.sort-column.is-over { border-color: var(--teal); background: var(--teal-soft); }
.sort-column-header { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.score { font-weight: 800; }
.capacity { color: var(--muted); font-size: 12px; }
.column-label { color: var(--muted); min-height: 17px; font-size: 11px; }
.sort-column .card { font-size: 12px; padding: 9px; }
.sort-column .card-id { min-width: 20px; height: 19px; font-size: 10px; }
.review-list { display: grid; gap: 9px; margin: 22px 0; }
.review-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 10px; background: #f8fbfb; }
.review-score { font-weight: 800; color: var(--teal-dark); }
.review-text { font-size: 14px; line-height: 1.45; }
.review-comment { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.question-list { display: grid; gap: 22px; margin: 24px 0; }
.question { display: grid; gap: 10px; }
.choice-list { display: grid; gap: 9px; }
.choice { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfd; }
.choice:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.done { text-align: center; }
.done-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 34px; }
.file-hint { color: var(--muted); line-height: 1.7; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 40; max-width: min(90vw, 480px); transform: translate(-50%, 130%); padding: 11px 15px; border-radius: 11px; background: #19333a; color: white; box-shadow: var(--shadow); opacity: 0; transition: transform .2s, opacity .2s; pointer-events: none; font-size: 14px; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.empty { color: var(--muted); padding: 16px; text-align: center; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 650px) {
  .app-main { padding-top: 14px; }
  .panel { border-radius: 16px; padding: 18px; }
  .rough-zones { grid-template-columns: 1fr; }
  .drop-zone { min-height: 88px; }
  .sort-head { align-items: center; }
  .hero h2 { font-size: 28px; }
  .hero-actions .button, .actions .button { flex: 1 1 140px; }
  .review-row { grid-template-columns: 55px 1fr; }
  .review-comment { grid-column: 2; }
  .score-dock { top: 64px; }
  .sort-workspace { grid-template-columns: 1fr; }
  .rough-targets { grid-template-columns: 1fr; }
  .score-targets { grid-template-columns: repeat(9, minmax(32px, 1fr)); }
}

/* Field-note visual direction: calm, low-saturation blue, coral and green. */
:root {
  --ink: #28353d;
  --muted: #6b7779;
  --blue: #55758b;
  --blue-dark: #425f73;
  --blue-soft: #e5edf2;
  --coral: #c98276;
  --coral-soft: #f4e5e1;
  --green: #668c7b;
  --green-soft: #e3eee8;
  --teal: var(--blue);
  --teal-dark: var(--blue-dark);
  --teal-soft: var(--blue-soft);
  --line: #d8dfe3;
  --paper: #fffefa;
  --canvas: #f2f4f3;
  --ochre: var(--coral);
  --ochre-soft: var(--coral-soft);
  --shadow: 0 16px 36px rgba(40, 53, 61, .07);
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body { background: var(--canvas); }
.app-shell { background: radial-gradient(circle at 8% 0%, rgba(201,130,118,.08), transparent 32rem); }
.app-header { background: rgba(255,254,250,.94); border-bottom-color: #d4dbd7; }
.brand-mark { width: 40px; height: 40px; border-radius: 9px 15px 9px 15px; background: var(--blue); color: #f8f7f1; font-family: Georgia, serif; box-shadow: 4px 4px 0 rgba(201,130,118,.24); }
.brand-copy h1, .hero h2, .panel h2 { font-family: "Noto Serif SC", "Songti SC", STSong, Georgia, serif; font-weight: 700; }
.eyebrow, .step-kicker { color: var(--ochre); letter-spacing: .12em; text-transform: uppercase; }
.step-kicker { margin: 0 0 6px; font-size: 11px; font-weight: 800; }
.panel { background: var(--paper); border-color: #d9dedb; border-radius: 13px 20px 13px 20px; box-shadow: var(--shadow); }
.hero { position: relative; overflow: hidden; }
.hero::after { content: "Q"; position: absolute; right: 5%; bottom: -16%; color: rgba(85,117,139,.05); font: 700 180px/1 Georgia, serif; pointer-events: none; }
.field-note { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: start; margin: 18px 0; padding: 13px 15px; border-left: 3px solid var(--ochre); background: var(--ochre-soft); color: #5d564d; line-height: 1.6; }
.field-note strong { color: #9d645c; font-size: 13px; white-space: nowrap; }
.field-note span { font-size: 13px; }
.intro-stats span { border-color: #dfe4df; background: #f8f8f3; }
.intro-stats b { color: var(--teal-dark); }
.button { border-radius: 9px; }
.button-primary { background: var(--teal); box-shadow: 0 5px 13px rgba(85,117,139,.18); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { border-color: #cfd8d4; background: #fffefa; }
.button-quiet { background: var(--blue-soft); color: var(--teal-dark); }
.progress-bar { background: var(--coral); }
.counter { color: var(--teal-dark); background: var(--blue-soft); }
.rough-target { border-color: #cfd8d4; color: var(--ink); }
.rough-target.positive { background: var(--green-soft); }
.rough-target.neutral { background: var(--coral-soft); }
.rough-target.negative { background: var(--blue-soft); }
.rough-target small { color: #697271; }
.rough-target em { display: block; margin-top: 5px; color: var(--teal-dark); font-size: 12px; font-style: normal; font-weight: 700; }
.card { border-color: #d5ddda; border-radius: 10px 15px 10px 15px; background: #fffefa; box-shadow: 0 3px 9px rgba(40,53,61,.05); }
.card[data-score] { background: var(--score-tone); border-color: rgba(85,117,139,.28); }
.card-select { color: var(--ink); }
.drag-handle { background: rgba(85,117,139,.07); color: var(--teal); }
.card-id { background: rgba(85,117,139,.12); color: var(--teal-dark); }
.card.is-selected { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(85,117,139,.14); }
.score-dock { border-color: #d4ddd8; background: rgba(255,254,250,.97); }
.score-target { background: var(--score-tone); border-color: rgba(85,117,139,.25); }
.score-target.active { border-color: var(--teal); background: var(--score-tone); box-shadow: 0 0 0 2px rgba(85,117,139,.15); }
.score-target.full { opacity: .78; }
.selection-note { color: #687474; }
.pool-section, .column-detail, .review-column { border-color: #d8dfdb; background: #fafaf5; }
.column-detail { background: #f5f6f1; background: color-mix(in srgb, var(--score-tone) 24%, #fffefa); }
.empty-slot { border-color: #cbd6d0; background: rgba(255,254,250,.65); }
.drag-ghost { border-color: var(--teal); background: #fffefa; }
.draft-tools { color: #77817f; }
.review-column h3 { color: var(--teal-dark); }
.done-icon { background: var(--green-soft); color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 650px) {
  .field-note { grid-template-columns: 1fr; gap: 3px; }
  .hero::after { font-size: 120px; right: 2%; bottom: -8%; }
  .card-select { padding: 14px 4px 14px 12px; }
  .drag-handle { min-height: 52px; }
}
