/* TAC·COM —— 战术通讯终端皮肤（CoD MW 味：军绿终端 + 琥珀描边 + 扫描线） */
:root {
  --bg: #050907;
  --panel: #0a1210;
  --panel2: #0d1815;
  --line: rgba(125, 250, 176, .16);
  --line2: rgba(125, 250, 176, .34);
  --grn: #7dfab0;
  --grn2: #3fbf7f;
  --amb: #ffb454;
  --red: #ff5d5d;
  --dim: #6f8f80;
  --txt: #d9ece1;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--mono);
  font-size: 14px;
  overflow: hidden;
  background-image:
    radial-gradient(1200px 600px at 50% -10%, rgba(63, 191, 127, .10), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(255, 180, 84, .06), transparent 60%);
}

/* 扫描线 + 暗角 */
.scan {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 4px);
  opacity: .45; mix-blend-mode: multiply;
}
.vig {
  position: fixed; inset: 0; z-index: 59; pointer-events: none;
  box-shadow: inset 0 0 220px rgba(0,0,0,.85), inset 0 0 60px rgba(0,0,0,.6);
}

.app {
  position: relative; z-index: 2;
  height: 100%; max-width: 920px; margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  padding: 0 12px;
}

/* ---------- 顶栏 ---------- */
.hud {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 2px 10px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bt { min-width: 0; }
.sigil {
  width: 30px; height: 30px; flex: none; position: relative;
  border: 1px solid var(--line2); transform: rotate(45deg);
  display: grid; place-items: center;
}
.sigil span {
  width: 10px; height: 10px; background: var(--grn);
  box-shadow: 0 0 10px var(--grn), 0 0 22px rgba(125,250,176,.5);
  animation: core 2.6s ease-in-out infinite;
}
@keyframes core { 0%,100% { opacity: .55; transform: scale(.86);} 50% { opacity: 1; transform: scale(1);} }
.bt h1 {
  font-size: 16px; letter-spacing: .22em; font-weight: 700; color: #eafff2;
  text-shadow: 0 0 12px rgba(125,250,176,.35);
}
.bt p {
  font-size: 9.5px; letter-spacing: .12em; color: var(--dim); margin-top: 3px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.bt p i { color: var(--grn2); font-style: normal; }
.hudright { display: flex; align-items: center; gap: 10px; flex: none; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.bars i {
  width: 3px; background: var(--grn2); opacity: .45;
  animation: bar 1.1s ease-in-out infinite;
}
.bars i:nth-child(1) { height: 5px; animation-delay: 0s; }
.bars i:nth-child(2) { height: 8px; animation-delay: .15s; }
.bars i:nth-child(3) { height: 12px; animation-delay: .3s; }
.bars i:nth-child(4) { height: 16px; animation-delay: .45s; }
.bars.live i { background: var(--grn); opacity: .9; }
@keyframes bar { 0%,100% { transform: scaleY(.55); } 50% { transform: scaleY(1); } }
.meta { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.link { font-size: 9.5px; letter-spacing: .14em; color: var(--dim); display: flex; align-items: center; gap: 5px; }
.link b {
  width: 6px; height: 6px; border-radius: 50%; background: var(--dim); flex: none;
}
.link.ok { color: var(--grn); }
.link.ok b { background: var(--grn); box-shadow: 0 0 8px var(--grn); animation: pulse 1.8s infinite; }
.link.bad { color: var(--red); }
.link.bad b { background: var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.clock { font-size: 11px; letter-spacing: .08em; color: #9fc7b3; }
.icon.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.icon.ghost.off { opacity: .35; }

/* ---------- 频道 ---------- */
.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0 8px; }
.ch {
  position: relative; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, rgba(20,36,30,.9), rgba(10,18,16,.9));
  border: 1px solid var(--line); border-radius: 4px;
  padding: 9px 11px 9px 13px; color: var(--dim);
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "code tg" "nm nm";
  gap: 2px 6px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.ch .code { grid-area: code; font-size: 9px; letter-spacing: .2em; color: var(--grn2); }
.ch .nm {
  grid-area: nm; font-size: 15px; color: #dff5e9; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch .nm i { font-style: normal; font-size: 10px; letter-spacing: .16em; color: var(--dim); margin-left: 6px; }
.ch .tg {
  grid-area: tg; align-self: start; justify-self: end;
  font-size: 10px; letter-spacing: .12em; color: var(--dim);
  border: 1px solid var(--line); padding: 2px 5px; border-radius: 3px;
}
.ch.on {
  border-color: rgba(255,180,84,.55);
  background: linear-gradient(180deg, rgba(48,34,18,.85), rgba(18,16,10,.9));
  box-shadow: 0 0 0 1px rgba(255,180,84,.18), 0 0 22px rgba(255,180,84,.12) inset;
}
.ch.on .code { color: var(--amb); }
.ch.on .tg { color: var(--amb); border-color: rgba(255,180,84,.4); }
.ch.on::after {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: var(--amb); box-shadow: 0 0 10px var(--amb);
}

/* ---------- 记录条 ---------- */
.logbar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 10px; color: var(--dim); letter-spacing: .08em;
}
.chname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.mini {
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  padding: 4px 8px; border-radius: 3px; cursor: pointer; flex: none;
}
.mini:hover { color: var(--grn); border-color: var(--line2); }
.mini.danger:hover { color: var(--red); border-color: rgba(255,93,93,.4); }

/* ---------- 通讯记录 ---------- */
.log { overflow-y: auto; padding: 12px 2px 16px; scroll-behavior: smooth; }
.log::-webkit-scrollbar { width: 4px; }
.log::-webkit-scrollbar-thumb { background: rgba(125,250,176,.2); }

.boot { padding: 26px 4px; color: var(--dim); font-size: 11.5px; line-height: 2; }
.boot .l1 { color: var(--grn2); letter-spacing: .16em; font-size: 10.5px; }
.boot .l2 { color: #a9c9b9; margin-top: 8px; }
.boot .l3 { color: var(--dim); }
.boot .l3 b { color: var(--amb); }
.cur {
  display: inline-block; width: 7px; height: 12px; background: var(--grn);
  margin-left: 6px; vertical-align: -1px; animation: blink 1.05s steps(2) infinite;
}
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

.msg {
  position: relative;
  border-left: 1px solid var(--line);
  padding: 9px 10px 10px 12px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(125,250,176,.045), transparent 65%);
  animation: in .28s ease-out;
}
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg::before {
  content: ""; position: absolute; left: -3px; top: 13px;
  width: 5px; height: 5px; background: var(--grn2); transform: rotate(45deg);
}
.msg.mine::before { background: var(--amb); }
.msg-h {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 9.5px; letter-spacing: .1em; color: var(--dim);
}
.msg-h .ts { color: var(--grn2); }
.msg-h .dir { color: var(--amb); }
.msg-h .sp { flex: 1; }
.msg-src { font-size: 12.5px; color: #96b5a6; line-height: 1.55; word-break: break-word; }
.msg-dst {
  font-size: 16px; line-height: 1.5; color: #eafff2; margin-top: 6px;
  word-break: break-word; text-shadow: 0 0 16px rgba(125,250,176,.16);
}
.msg-dst.zh { color: #fff3d6; text-shadow: 0 0 16px rgba(255,180,84,.14); }
.msg-err { color: var(--red); font-size: 12px; margin-top: 6px; }
.msg-act { display: flex; gap: 6px; margin-top: 8px; }
.actbtn {
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  padding: 4px 8px; border-radius: 3px; cursor: pointer;
}
.actbtn:hover { color: var(--grn); border-color: var(--line2); background: rgba(125,250,176,.06); }
.actbtn:active { transform: translateY(1px); }
.actbtn.playing {
  color: var(--amb); border-color: rgba(255,180,84,.55); background: rgba(255,180,84,.10);
  animation: pulse 1.1s infinite;
}
.typing { display: inline-flex; gap: 3px; padding: 4px 0; }
.typing i {
  width: 4px; height: 4px; background: var(--grn); border-radius: 50%;
  animation: dot 1s infinite;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- 输入区 ---------- */
.dock {
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5,9,7,.6), rgba(5,9,7,.96));
  backdrop-filter: blur(8px);
}
.dirbar { display: flex; gap: 6px; margin-bottom: 8px; }
.dirbtn {
  flex: 1; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--dim);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  padding: 6px 4px; border-radius: 3px;
}
.dirbtn b { color: var(--amb); }
.dirbtn.on { border-color: rgba(125,250,176,.5); color: var(--grn); background: rgba(125,250,176,.08); }
.dirbtn.on b { color: var(--grn); }
.dirbtn.saybtn { flex: 0 0 40px; padding: 6px 0; font-size: 13px; line-height: 1; }
.dirbtn.saybtn.on { color: var(--grn); }
.dirbtn.demobtn { flex: 0 0 54px; padding: 6px 0; font-size: 9.5px; letter-spacing: .02em; }
.dirbtn.demobtn:active { color: var(--grn); }

.inputbar {
  display: flex; align-items: flex-end; gap: 8px;
  border: 1px solid var(--line2); border-radius: 5px;
  background: rgba(10,20,16,.9); padding: 6px;
}
.mic {
  width: 44px; height: 44px; flex: none; border-radius: 4px; cursor: pointer;
  background: rgba(255,180,84,.10); border: 1px solid rgba(255,180,84,.45);
  display: grid; place-items: center;
}
.mic svg { width: 20px; height: 20px; fill: var(--amb); }
.mic svg path[fill="none"] { stroke: var(--amb); fill: none; }
.mic:active, .mic.rec { background: rgba(255,93,93,.18); border-color: var(--red); }
.mic.rec svg { fill: var(--red); }
.mic.rec svg path[fill="none"] { stroke: var(--red); }
#txt {
  flex: 1; min-width: 0; resize: none; max-height: 120px;
  background: transparent; border: none; outline: none;
  color: var(--txt); font-family: var(--mono); font-size: 14.5px; line-height: 1.5;
  padding: 11px 2px;
}
#txt::placeholder { color: #54705f; font-size: 13px; }
.send {
  height: 44px; flex: none; padding: 0 16px; cursor: pointer; border-radius: 4px;
  background: rgba(125,250,176,.14); border: 1px solid var(--line2); color: var(--grn);
  font-family: var(--mono); font-size: 13px; letter-spacing: .1em;
}
.send:active { background: rgba(125,250,176,.28); color: #04120a; }
.send[disabled] { opacity: .45; }

.meter {
  display: flex; align-items: center; gap: 2px; height: 14px; margin-top: 6px; padding-left: 2px;
}
.meter span { width: 3px; height: 3px; background: var(--grn2); opacity: .25; }
.meter span:nth-child(odd) { height: 6px; }
.meter.busy span { opacity: .75; animation: bar .8s ease-in-out infinite; }
.meter.busy span:nth-child(2n) { animation-delay: .1s; }
.meter.busy span:nth-child(3n) { animation-delay: .2s; }
.meter em {
  font-style: normal; font-size: 9px; letter-spacing: .16em; color: var(--dim); margin-left: 8px;
}

/* ---------- 录音浮条 ---------- */
.recbar {
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%);
  z-index: 40; display: flex; align-items: center; gap: 10px;
  background: rgba(28,8,8,.94); border: 1px solid rgba(255,93,93,.6);
  border-radius: 4px; padding: 9px 14px; color: #ffd7d7; font-size: 11.5px;
  box-shadow: 0 0 30px rgba(255,93,93,.25);
}
.recbar .dot {
  width: 8px; height: 8px; background: var(--red); border-radius: 50%;
  animation: pulse .9s infinite;
}
.recbar b { color: #fff; letter-spacing: .08em; }
.recwave { display: flex; align-items: center; gap: 2px; height: 14px; }
.recwave i { width: 2px; background: var(--red); animation: wv .7s infinite; }
.recwave i:nth-child(1) { animation-delay: 0s; }
.recwave i:nth-child(2) { animation-delay: .1s; }
.recwave i:nth-child(3) { animation-delay: .2s; }
.recwave i:nth-child(4) { animation-delay: .3s; }
.recwave i:nth-child(5) { animation-delay: .15s; }
.recwave i:nth-child(6) { animation-delay: .25s; }
.recwave i:nth-child(7) { animation-delay: .05s; }
.recwave i:nth-child(8) { animation-delay: .35s; }
@keyframes wv { 0%,100% { height: 3px; } 50% { height: 14px; } }
.rechint { color: #b98c8c; font-size: 10px; letter-spacing: .06em; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 168px; transform: translate(-50%, 12px);
  z-index: 70; padding: 8px 16px; border-radius: 4px;
  background: rgba(8,20,14,.96); border: 1px solid var(--line2);
  color: var(--grn); font-size: 12px; letter-spacing: .06em;
  opacity: 0; pointer-events: none; transition: all .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { color: #ffc9c9; border-color: rgba(255,93,93,.5); }

/* ---------- 手机 ---------- */
@media (max-width: 520px) {
  .app { padding: 0 9px; }
  .bt h1 { font-size: 14.5px; letter-spacing: .18em; }
  .bt p { font-size: 8.5px; letter-spacing: .06em; }
  .sigil { width: 26px; height: 26px; }
  .bars { display: none; }
  .icon.ghost { width: 28px; height: 28px; font-size: 12px; }
  .hudright { gap: 7px; }
  .bt p { display: none; }
  .meta { max-width: 116px; }
  .link { max-width: 116px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .ch { padding: 7px 8px 8px 10px; }
  .ch .nm { font-size: 13.5px; }
  .ch .nm i { display: none; }
  .ch .tg { font-size: 9px; padding: 2px 4px; letter-spacing: .06em; }
  .msg-dst { font-size: 15.5px; }
  .logbar { font-size: 9px; }
  .inputbar { padding: 5px; gap: 6px; }
  .send { padding: 0 12px; }
  .recbar { bottom: 112px; }
}
@media (max-width: 360px) {
  .bt p { display: none; }
  .ch .nm i { display: none; }
}
