/* 树融呼叫台 —— 校园门条 + 红印章 视觉
   纸面青瓷绿 / 墨蓝正文 / 印泥朱红主色 / 楷体题字 */
:root {
  --paper: #EAF1EC;      /* 青瓷绿纸面 */
  --card: #FFFFFF;
  --ink: #223047;        /* 墨蓝 */
  --ink-2: #66727F;
  --seal: #C2402A;       /* 印泥朱红 */
  --seal-deep: #A33322;
  --line: #D9E3DC;
  --wait-bg: #F8ECD7;  --wait-fg: #9A6B10;
  --done-bg: #DFF0E7;  --done-fg: #2E7D57;
  --disp: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "Noto Serif SC", serif;
  --body: -apple-system, "PingFang SC", "Microsoft YaHei", "MiSans", "HarmonyOS Sans SC", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(194,64,42,.05), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(34,48,71,.06), transparent 55%),
    var(--paper);
  min-height: 100dvh;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid rgba(194,64,42,.45); outline-offset: 2px; border-radius: 6px; }

/* ---------------- 登录门条 ---------------- */
.view-login { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.slip {
  position: relative; width: min(380px, 100%);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(34,48,71,.10);
  padding: 34px 30px 26px;
  text-align: center;
}
.slip::before, .slip::after {  /* 装订打孔 */
  content: ""; position: absolute; top: 14px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line);
}
.slip::before { left: 14px; } .slip::after { right: 14px; }
.slip-hole { display: none; }
.slip-eyebrow {
  font-size: 12px; letter-spacing: .35em; color: var(--seal);
  border-bottom: 1px dashed var(--line); padding-bottom: 12px; margin-bottom: 18px;
}
.slip-title { font-family: var(--disp); font-size: 34px; font-weight: 700; letter-spacing: .12em; }
.slip-sub { color: var(--ink-2); font-size: 14px; margin: 10px 0 22px; }
.slip-input {
  width: 100%; padding: 12px 14px; font-size: 18px; letter-spacing: .3em;
  text-align: center; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 6px; background: #FBFCFB;
}
.slip-input:focus { border-color: var(--seal); outline: none; }
.btn-slip {
  width: 100%; margin-top: 14px; padding: 13px 0;
  background: var(--ink); color: #fff; border: none; border-radius: 6px;
  font-size: 16px; letter-spacing: .2em;
  transition: transform .08s ease, background .15s ease;
}
.btn-slip:hover { background: #2E3F5C; }
.btn-slip:active { transform: translateY(1px); }
.slip-err { margin-top: 12px; color: var(--seal-deep); font-size: 13px; }
.slip-foot {
  margin-top: 26px; padding-top: 12px; border-top: 1px dashed var(--line);
  font-size: 10px; letter-spacing: .3em; color: var(--ink-2);
}

/* ---------------- 顶栏 ---------------- */
#view-console { max-width: 1060px; margin: 0 auto; padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--disp); font-size: 22px; font-weight: 700; letter-spacing: .1em; }
.brand-seal {
  width: 14px; height: 14px; background: var(--seal); border-radius: 3px;
  transform: rotate(45deg); box-shadow: 2px 2px 0 rgba(34,48,71,.15);
}
.linklike { background: none; border: none; color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.linklike:hover { color: var(--seal-deep); }

/* ---------------- 主区 ---------------- */
.grid { display: grid; grid-template-columns: 5fr 7fr; gap: 18px; align-items: start; }
.card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  box-shadow: 0 2px 10px rgba(34,48,71,.05);
  padding: 22px;
}
.card-title { font-family: var(--disp); font-size: 20px; letter-spacing: .14em; margin-bottom: 18px; }

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .2em; }
.field-tip { font-style: normal; letter-spacing: .02em; color: #9AA5AF; }
.field-input {
  width: 100%; padding: 11px 12px; font-size: 16px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 8px; background: #FBFCFB;
  appearance: none; -webkit-appearance: none;
}
.field-input::placeholder { color: #A9B3BC; }
select.field-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%2366727F' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.field-input:focus { border-color: var(--seal); outline: none; }

/* ---------------- 学生自动补全 ---------------- */
.ac { position: relative; }
.ac-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 10px;
  box-shadow: 4px 6px 0 rgba(34,48,71,.08), 0 14px 30px rgba(34,48,71,.14);
  list-style: none; max-height: 274px; overflow-y: auto; z-index: 30; padding: 6px;
}
.ac-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 11px 12px; border-radius: 8px; cursor: pointer;
}
.ac-list li:hover, .ac-list li.active { background: #F2F6F3; }
.ac-list li.ac-empty { justify-content: center; color: var(--ink-2); cursor: default; font-size: 14px; }
.ac-list li.ac-empty:hover { background: none; }
.ac-name { font-size: 15.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.ac-py { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-hit { color: var(--seal); font-weight: 700; }

/* 印章式呼叫按钮（签名元素） */
.stamp {
  display: block; width: 100%; margin-top: 20px; padding: 22px 0;
  background: linear-gradient(160deg, var(--seal), var(--seal-deep));
  color: #FFF6EF; border: none; border-radius: 10px;
  font-family: var(--disp); font-size: 30px; font-weight: 700; letter-spacing: 1.2em; text-indent: 1.2em;
  box-shadow: inset 0 0 0 3px rgba(255,246,239,.35), inset 0 0 0 5px var(--seal), 5px 6px 0 rgba(34,48,71,.16);
  transform: rotate(-1.2deg);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.stamp:hover { filter: brightness(1.05); }
.stamp:active, .stamp.stamping {
  transform: rotate(-1.2deg) scale(.97);
  box-shadow: inset 0 0 0 3px rgba(255,246,239,.35), inset 0 0 0 5px var(--seal), 2px 3px 0 rgba(34,48,71,.16);
}
.stamp[disabled] { filter: grayscale(.35) brightness(.95); cursor: wait; }
.call-hint { margin-top: 14px; font-size: 12.5px; color: var(--ink-2); text-align: center; }

/* ---------------- 广播记录 ---------------- */
.feed-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.feed-note { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.feed { list-style: none; max-height: 420px; overflow-y: auto; }
.feed li {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 4px; border-bottom: 1px dashed var(--line);
}
.feed li:last-child { border-bottom: none; }
.feed-time { font-family: var(--mono); font-size: 12px; color: var(--ink-2); min-width: 128px; }
.feed-line { font-size: 15px; }
.feed-line .who { font-weight: 600; }
.feed-line .arr { color: var(--seal); margin: 0 6px; font-weight: 700; }
.chip {
  margin-left: auto; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  letter-spacing: .1em;
}
.chip.wait { background: var(--wait-bg); color: var(--wait-fg); }
.chip.done { background: var(--done-bg); color: var(--done-fg); }
.chip.cancel { background: #E9EBEE; color: #5A6472; }
.feed-empty { color: var(--ink-2); font-size: 14px; text-align: center; padding: 26px 0 !important; display: block; }

/* ---------------- 名单管理 ---------------- */
.panel-manage { margin-top: 18px; padding: 0 22px; }
.panel-manage summary {
  list-style: none; cursor: pointer; padding: 16px 0;
  font-family: var(--disp); font-size: 18px; letter-spacing: .14em; color: var(--ink);
}
.panel-manage summary::-webkit-details-marker { display: none; }
.panel-manage summary::after { content: "展开"; font-family: var(--body); font-size: 12px; color: var(--ink-2); margin-left: 12px; letter-spacing: .1em; }
.panel-manage[open] summary::after { content: "收起"; }
.panel-manage[open] summary { border-bottom: 1.5px solid var(--line); }
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 18px 0 22px; }
.manage-col h3 { font-size: 14px; color: var(--ink-2); letter-spacing: .2em; margin-bottom: 10px; }
.manage-add { display: flex; gap: 8px; margin-bottom: 10px; }
.manage-add .field-input { padding: 9px 10px; font-size: 14px; }
.btn-mini {
  padding: 0 16px; background: var(--ink); color: #fff; border: none; border-radius: 8px; font-size: 14px;
  transition: background .15s ease;
}
.btn-mini:hover { background: #2E3F5C; }
.manage-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.manage-list li {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F2F6F3; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 6px 4px 12px; font-size: 14px;
}
.manage-list button {
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: transparent; color: var(--ink-2); font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.manage-list button:hover { background: var(--wait-bg); color: var(--seal-deep); }

.foot { text-align: center; color: var(--ink-2); font-size: 12px; padding: 22px 0 0; letter-spacing: .1em; }

/* ---------------- 安卓下载条 ---------------- */
.apk-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  background: var(--ink); color: #fff; text-decoration: none;
  padding: 12px 26px; border-radius: 999px; font-size: 15px; letter-spacing: .12em;
  box-shadow: 0 6px 18px rgba(34,48,71,.28);
  z-index: 50;
}
.apk-bar:active { transform: translateX(-50%) scale(.97); }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 14px;
  padding: 11px 20px; border-radius: 8px; box-shadow: 0 8px 22px rgba(34,48,71,.3);
  z-index: 60; max-width: min(92vw, 480px); text-align: center;
}
.toast.err { background: var(--seal-deep); }

/* ---------------- 响应式（平板 / 手机） ---------------- */
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .feed { max-height: 320px; }
  .manage-grid { grid-template-columns: 1fr; }
  .slip-title { font-size: 30px; }
  .stamp { font-size: 26px; }
  .card { padding: 18px; }
  .feed-line { font-size: 14.5px; }
  .feed-time { min-width: 112px; }
}
@media (min-width: 761px) and (max-width: 1024px) {
  .grid { grid-template-columns: 5fr 7fr; gap: 14px; }
  .card { padding: 18px; }
}
@media (pointer: coarse) {
  .field-input { min-height: 48px; }
  .btn-mini { min-height: 48px; }
  .stamp { padding: 24px 0; }
  .feed li { padding: 14px 4px; }
  .manage-list li { padding: 7px 8px 7px 14px; }
  .manage-list button { width: 28px; height: 28px; font-size: 16px; }
  .ac-list li { padding: 14px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
