/* 金陵学诚 · 家教单库 —— 品牌样式
   配色：藏青 #11273F / 铜金 #C09A58 / 米白 #F6F5F0 / 品牌绿 #186848 / 标题 #193656 */
:root {
  --navy: #11273F;
  --gold: #C09A58;
  --bg: #F6F5F0;
  --green: #186848;
  --title: #193656;
  --card: #FFFFFF;
  --ink: #1F2A37;
  --ink-2: #4B5867;
  --muted: #8A93A0;
  --line: #E6E2D8;
  --line-strong: #D5CFC1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 39, 63, .05), 0 8px 22px -14px rgba(17, 39, 63, .28);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 12px 26px;
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 11px; }
.crest {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green);
  color: #fff;
  font-family: var(--serif); font-size: 20px; font-weight: 700;
  border: 2px solid rgba(255, 255, 255, .55);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
  flex-shrink: 0;
}
.brand-text h1 {
  margin: 0;
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  letter-spacing: 2px; line-height: 1.2;
  white-space: nowrap;
}
.brand-text p {
  margin: 2px 0 0; font-size: 11.5px; letter-spacing: 3px; color: rgba(255, 255, 255, .72);
}

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  position: relative;
  min-width: 86px;
  padding: 6px 12px 8px;
  background: rgba(255, 255, 255, .06);
  border-radius: 8px;
  border-bottom: 1px solid var(--gold);
  display: flex; flex-direction: column; gap: 1px;
}
.stat-no { font-family: var(--mono); font-size: 10px; color: var(--gold); letter-spacing: 1px; }
.stat b {
  font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--gold);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-label { font-size: 11.5px; color: rgba(255, 255, 255, .75); }

.actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: rgba(255, 255, 255, .85);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 5px 11px; border-radius: 999px;
}
.who::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.btn {
  border: 1px solid rgba(255, 255, 255, .38);
  background: transparent;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: .15s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.topbar .btn:not(.primary) { background: #fff; color: var(--navy); border-color: #fff; }
.topbar .btn:not(.primary):hover { background: #F1EFE8; }
.btn.primary {
  background: var(--green); border-color: var(--green); color: #fff; font-weight: 600;
}
.btn.primary:hover { background: #14563c; }
.btn.ghost { background: transparent; }
.btn.danger { color: #FFD9D9; border-color: rgba(255, 160, 160, .5); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }

/* 弹窗和卡片里的按钮用深色文字 */
dialog .btn { border-color: var(--line-strong); color: var(--ink); background: var(--card); }
dialog .btn:hover { background: #F3F1EA; }
dialog .btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
dialog .btn.primary:hover { background: #14563c; }
dialog .btn.danger { color: #9B2C2C; border-color: #E7C4C4; }

/* ---------- 主体 ---------- */
main { padding: 20px 26px 40px; max-width: 1480px; margin: 0 auto; }

.filters {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid; gap: 10px;
}
.row-main { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.search { position: relative; flex: 1 1 300px; min-width: 200px; }
.search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
.search input {
  width: 100%; padding: 9px 12px 9px 35px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #FBFAF6; outline: none;
}
.search input:focus { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(192, 154, 88, .16); }

.tabs { display: flex; gap: 4px; padding: 3px; background: #F1EFE8; border-radius: 9px; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 7px;
  cursor: pointer; font-size: 13.5px; color: var(--ink-2); transition: .15s;
}
.tab:hover { color: var(--navy); }
.tab.active { background: var(--card); color: var(--navy); font-weight: 600; box-shadow: 0 1px 3px rgba(17, 39, 63, .12); }

.row-selects { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-selects select, .row-selects input[type=number] {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #FBFAF6; outline: none; font-size: 13.5px; max-width: 100%;
}
.row-selects select:focus, .row-selects input:focus {
  border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(192, 154, 88, .16);
}
.row-selects select { padding-right: 24px; }

.price-range { display: inline-flex; align-items: center; gap: 5px; padding: 0 2px; }
.price-range input { width: 78px; }
.price-range span { color: var(--muted); }
.price-range em { font-style: normal; font-size: 12px; color: var(--muted); }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--green); }

.link {
  border: 0; background: none; color: var(--ink-2); font-size: 13px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px;
}
.link:hover { color: var(--gold); }

.result-bar { display: flex; align-items: center; gap: 12px; margin: 16px 2px 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.result-bar .hint { color: var(--muted); }

/* ---------- 单子卡片 ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }

.order {
  display: grid;
  grid-template-columns: max-content minmax(180px, 1.4fr) minmax(150px, 1fr) max-content 96px 104px max-content;
  gap: 14px;
  align-items: center;
  padding: 14px 16px 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: .15s ease;
}
.order:hover { border-color: var(--line-strong); border-left-color: var(--gold); transform: translateY(-1px); }
.order.is-off { opacity: .6; }
.order.is-off .o-title { text-decoration: line-through; text-decoration-color: var(--muted); }

.o-code { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.o-code-main {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  letter-spacing: -.2px; white-space: nowrap;
}
.o-srcno {
  font-family: var(--mono); font-size: 10.5px; color: var(--gold);
  max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.o-title {
  font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--title);
  letter-spacing: .5px;
}
.o-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-area { font-size: 13px; color: var(--ink-2); min-width: 0; }
.o-price {
  font-family: var(--serif); font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 17px; color: var(--navy); white-space: nowrap;
}
.o-price small { font-family: var(--sans); font-weight: 400; font-size: 11.5px; color: var(--muted); margin-left: 2px; }
.o-price .weekly { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--muted); font-weight: 400; }
.o-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.o-actions { display: flex; gap: 4px; justify-content: flex-end; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.open { color: var(--green); background: #E7F1EC; border-color: #C9E0D5; }
.badge.matched { color: var(--navy); background: #E9EDF3; border-color: #CFD8E4; }
.badge.done { color: #8A6A2F; background: #F6EEDF; border-color: #E5D3B0; }
.badge.off { color: var(--muted); background: #F0EEE8; }

.empty {
  text-align: center; padding: 70px 20px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty b { display: block; color: var(--title); font-family: var(--serif); font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- 弹层 ---------- */
dialog.panel {
  border: 1px solid var(--line);
  border-radius: 14px; padding: 0;
  background: var(--card); color: var(--ink);
  box-shadow: 0 28px 70px -24px rgba(17, 39, 63, .5);
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
}
dialog.wide { width: min(900px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(17, 39, 63, .55); }
dialog:focus { outline: none; }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

.panel-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px 14px;
  background: var(--navy); color: #fff;
  border-radius: 14px 14px 0 0;
  border-bottom: 3px solid var(--gold);
}
.panel-head h2 { margin: 3px 0 0; font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.panel-code { font-family: var(--mono); font-size: 11.5px; color: rgba(255, 255, 255, .62); }
.panel-head .icon-btn { color: rgba(255, 255, 255, .75); }
.panel-head .icon-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.panel-body { padding: 18px 20px; overflow: auto; max-height: calc(100vh - 220px); }
.panel-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #FBFAF6;
  border-radius: 0 0 14px 14px;
  flex-wrap: wrap;
}
.grow { flex: 1; }
.icon-btn {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; color: var(--muted); font-size: 14px;
}
.icon-btn:hover { background: #F1EFE8; color: var(--navy); }
.icon-btn:focus { outline: none; }
.icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.err { color: #9B2C2C; font-size: 13px; }
.hint-text { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* 解析提示：未识别的关键字段用黄色标出 */
.parse-banner {
  margin: 0 0 14px; padding: 10px 13px; border-radius: 8px;
  background: #FBF7EC; border: 1px solid #E9DDC2;
  color: var(--ink-2); font-size: 13px; line-height: 1.9;
}
.parse-banner b { color: var(--navy); }
.miss-tip { color: #8A6A2F; }
.miss-chip {
  display: inline-block; margin: 0 4px 0 0; padding: 1px 8px;
  background: #FCE9A8; color: #7A5310; border-radius: 4px; font-weight: 600;
}
.field.miss input, .field.miss select { border-color: #D9B45A; background: #FEF8E6; }
.field.miss > span::after { content: " · 待补"; color: #8A6A2F; }
.conf {
  font-style: normal; font-size: 10.5px; font-weight: 600;
  margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  vertical-align: 1px;
}
.conf-exact, .conf-synonym, .conf-proximity { background: #E7F1EC; color: #186848; }
.conf-none { background: #F0EEE8; color: #8A93A0; }
.conf-miss { background: #FBE9A8; color: #7A5310; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span2 { grid-column: span 2; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #FBFAF6; outline: none; width: 100%; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(192, 154, 88, .16);
}

#paste-text {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #FBFAF6; outline: none; resize: vertical; line-height: 1.6;
}
#paste-text:focus { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px rgba(192, 154, 88, .16); }

/* 详情 */
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 7px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; padding-top: 1px; }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.kv .big { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--navy); }
.sect-title {
  font-size: 11.5px; letter-spacing: .12em; color: var(--gold);
  margin: 22px 0 10px; text-transform: uppercase;
}
.raw {
  white-space: pre-wrap; background: #FBFAF6; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-2);
  max-height: 260px; overflow: auto;
}
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); display: grid; gap: 11px; }
.timeline li { position: relative; font-size: 13px; color: var(--ink-2); }
.timeline li::before {
  content: ""; position: absolute; left: -18.5px; top: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); border: 2px solid #fff;
}
.timeline time { display: block; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 多端同步横幅 ---------- */
.update-banner {
  position: sticky;
  top: 68px;
  z-index: 19;
  margin: 0 auto;
  width: fit-content;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px 7px 14px;
  background: #FFF6DF;
  border: 1px solid #E4C98A;
  border-radius: 999px;
  box-shadow: 0 6px 18px -10px rgba(17, 39, 63, .45);
  font-size: 13px; color: #6B4A17;
}
.update-banner .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 3px rgba(192, 154, 88, .22);
}
.update-banner .ubtn {
  border: 0; cursor: pointer;
  background: var(--navy); color: #fff;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
}
.update-banner .ubtn:hover { background: #1b3a5a; }

/* ---------- 联系方式 / 申请人 ---------- */
.contact-tip {
  grid-column: 1 / -1;
  margin: -2px 0 2px;
  font-size: 12px;
  color: #8A6A2F;
  background: #FEF8E6;
  border: 1px dashed #E4C98A;
  border-radius: 8px;
  padding: 7px 10px;
}
.contact-full {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  background: #E7F1EC;
  color: #186848;
  border-radius: 5px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
}
.applicant {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 2px; border-top: 1px solid var(--line);
}
.applicant:first-child { border-top: 0; }
.ap-main { flex: 1; min-width: 0; }
.ap-main b { font-size: 14px; color: var(--title); }
.ap-meta { font-size: 12.5px; color: #6B7684; margin-top: 2px; }
.ap-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ap-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.empty-hint { padding: 24px 0; text-align: center; color: var(--muted); }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--navy); color: rgba(255, 255, 255, .8);
  padding: 14px 26px; font-size: 12.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 3px solid var(--gold);
}
.site-footer b { color: #fff; font-weight: 600; }
.site-footer .foot-right { color: rgba(255, 255, 255, .7); }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--navy); color: #FDFBF6;
  padding: 10px 18px; border-radius: 8px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: .22s ease; z-index: 100;
  box-shadow: 0 12px 30px -12px rgba(17, 39, 63, .6);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .order {
    grid-template-columns: max-content minmax(140px, 1fr) minmax(120px, 1fr) max-content;
    grid-template-areas:
      "code title area price"
      "code status time actions";
    row-gap: 6px;
  }
  .o-code { grid-area: code; }
  .o-title-cell { grid-area: title; }
  .o-area { grid-area: area; }
  .o-price { grid-area: price; }
  .o-status { grid-area: status; }
  .o-time { grid-area: time; }
  .o-actions { grid-area: actions; }
}

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 10px 12px; gap: 10px 8px; }
  .brand { order: 1; }
  .brand-text h1 { font-size: 17px; letter-spacing: 1.5px; }
  .brand-text p { letter-spacing: 2px; }

  .actions {
    order: 2; margin-left: auto; flex: 1 1 100%; max-width: 100%;
    justify-content: flex-end; gap: 6px; flex-wrap: wrap;
  }
  .actions .btn { padding: 7px 10px; font-size: 13px; }

  .stats {
    order: 3; flex: 1 1 100%; max-width: 100%;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
  }
  .stat { min-width: 0; padding: 6px 8px 7px; }
  .stat b { font-size: 17px; }
  .stat-label { font-size: 10.5px; letter-spacing: 0; }
  .stat-no { font-size: 9.5px; }

  main { padding: 14px 12px 28px; }
  .grid { grid-template-columns: 1fr; }
  .field.span2 { grid-column: auto; }
  .filters { padding: 12px; }
  .row-main, .row-selects { gap: 8px; }
  .row-selects select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .search { flex: 1 1 100%; }
  .tabs { flex: 1 1 100%; justify-content: space-between; }
  .tab { padding: 6px 8px; font-size: 13px; }
  .empty { padding: 44px 16px; }

  .order {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "code price"
      "title title"
      "area area"
      "status time"
      "actions actions";
    gap: 6px 10px;
    padding: 12px 12px 12px 14px;
  }
  .o-title { font-size: 15.5px; }
  .o-actions { justify-content: flex-end; }
  .o-srcno { max-width: none; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; }
  .panel-head { padding: 14px 16px 12px; }
  .panel-body { padding: 14px 16px; max-height: calc(100vh - 210px); }
  .panel-foot { padding: 10px 16px; }
  .kv { grid-template-columns: 74px 1fr; }
}

@media (max-width: 400px) {
  .topbar { padding: 9px 12px; }
  .crest { width: 34px; height: 34px; font-size: 17px; }
  .brand-text h1 { font-size: 16px; letter-spacing: 1px; }
  .btn { padding: 7px 10px; font-size: 12.5px; }
  .actions .btn { padding: 6px 9px; }
  .stat b { font-size: 16px; }
  .row-selects select { flex: 1 1 100%; }
  dialog.panel, dialog.wide { width: calc(100vw - 16px); }
  .empty { padding: 34px 12px; }
}

/* ---------- 单次时长：自定义 ---------- */
.dur-row { display: flex; gap: 8px; align-items: center; }
.dur-row input { flex: 1 1 auto; min-width: 0; width: auto; }
.dur-row select { flex: 0 0 92px; width: 92px; }
