:root {
  --ink: #172e43;
  --muted: #4e6374;
  --teal: #00685f;
  --line: #cfdbdf;
  --paper: #f3f6f6;
  font-family: system-ui, "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
* { box-sizing: border-box }
body { margin: 0 }
.wrap { width: min(100% - 40px, 1024px); margin-inline: auto }
.masthead {
  color: white;
  border-bottom: 4px solid #40b7a4;
  background-color: #162e42;
  background-image: repeating-radial-gradient(circle at 85% 120%, transparent 0 27px, #88d5ce21 28px 29px, transparent 30px 56px);
}
.brand { display: flex; align-items: center; gap: 16px; padding-block: 20px }
h1,h2,h3,p { margin-top: 0 }
.brand h1 { margin: 0; font-size: 1.7rem; letter-spacing: .08em; line-height: 1.22 }
.wordmark,.eyebrow { font-weight: 730; font-size: .72rem; letter-spacing: .19em; color: #a0e2d6 }
.radar-mark {
  width: 45px; height: 45px; border-radius: 50%; border: 1px solid #8cd1c3;
  background: radial-gradient(circle at 68% 34%, #d8ffe9 0 2px, transparent 3px),
    repeating-radial-gradient(circle, transparent 0 6px, #94d8cb88 7px 8px),
    conic-gradient(from 6deg, #479189 0deg, #245353 58deg, transparent 59deg);
}
nav { display: flex; gap: 4px; padding-block: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line) }
nav a, summary, button { font-weight: 650 }
nav a { text-decoration: none; color: var(--muted); padding: 9px 16px; border-radius: 8px }
nav a:hover,summary:hover { color: var(--teal); background: #e7efef }
nav a[aria-current=page] { color: white; background: var(--ink) }
section { margin-block: 24px; padding: clamp(18px,3vw,34px); background: white; border: 1px solid var(--line); border-radius: 16px }
.sectiontitle,.toolbar,.metadata,.source,.actions,.tags,.botrow,.topic-row,.topic-controls { display: flex; align-items: center; gap: 10px }
.sectiontitle,.toolbar,.botrow,.topic-row { justify-content: space-between }
.sectiontitle { flex-wrap: wrap; margin-bottom: 12px }
h2 { font-size: clamp(1.45rem,3vw,2rem); letter-spacing: -.025em; margin-bottom: 16px }
.sectiontitle h2,.sectiontitle label { margin: 0 }
h3 { font-size: 1.15rem; margin-bottom: 8px }
.count { font-variant-numeric: tabular-nums; font-size: 1rem; border-radius: 8px; background: #e3f3ef; color: var(--teal); padding: 4px 10px; vertical-align: middle }
.toolbar { align-items: flex-start; margin: 12px 0 20px; flex-wrap: wrap }
.preference { flex: 1 1 220px }
summary { cursor: pointer; padding: 9px 4px; color: #2b5664 }
.card { margin: 0 0 16px; padding: clamp(16px,2.5vw,26px); border: 1px solid var(--line); border-radius: 12px }
.news { box-shadow: 0 3px 12px #132d4210 }
.news h3 { font-size: clamp(1.15rem,2vw,1.38rem); line-height: 1.48; margin: 10px 0 6px; overflow-wrap: anywhere }
.metadata,.source,.tags,.actions { flex-wrap: wrap }
.metadata,.source,.muted,.hint,small { color: var(--muted); font-size: .88rem }
.badge,.tag { display: inline-block; padding: 2px 9px; border-radius: 5px; font-size: .8rem }
.badge { font-weight: 700 }
.pending { background: #fff1ce; color: #785009 }
.approved { background: #dcf3eb; color: #125b45 }
.rejected { background: #eee9ed; color: #664b5d }
.abstract { white-space: pre-line; overflow-wrap: anywhere; margin-bottom: 10px }
.source a,a { color: var(--teal) }
.tags { gap: 5px; margin-top: 8px }
.tag { background: #edf2f5; color: #435c6c }
.editor { margin-top: 10px; border-top: 1px solid #e4eaec }
.decisions { margin-top: 6px }
button { border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 650; background: var(--teal); color: white; cursor: pointer; min-height: 44px }
button:hover { background: #005550 }
.outline,.quiet { background: white; color: var(--ink); border-color: #b7c8ca }
.quiet { color: var(--teal); border-color: transparent }
.outline:hover,.quiet:hover { background: #e6f2ef; color: #064f49 }
button:disabled { opacity: .55; cursor: default }
:focus-visible { outline: 3px solid #387dba; outline-offset: 2px }
.sharebox,.guide,#botEditor,.preference[open] { background: #f3f7f8; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px }
.sharebox li,.run { overflow-wrap: anywhere }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px }
label { display: block; font-weight: 600; margin-block: 12px }
input,select,textarea { display: block; width: 100%; max-width: 100%; margin-top: 4px; padding: 9px 12px; font: inherit; color: var(--ink); border: 1px solid #acbec5; border-radius: 8px; background: white }
textarea { min-height: 90px; resize: vertical }
.check { display: flex; align-items: center; gap: 8px }
.check input { width: auto; margin: 0; accent-color: var(--teal) }
small { display: block; font-weight: 400 }
.actions { margin-block: 12px 0 }
.botrow,.run,.topic-row { border-bottom: 1px solid var(--line); padding: 12px 0 }
.botrow { flex-wrap: wrap }
.topic-controls { flex-shrink: 0 }
.topic-controls button { min-width: 44px }
form, #botEditor, .guide { margin-top: 16px }
#notice:not(:empty) { background: #fff3d8; color: #654917; border-left: 4px solid #ac781f; padding: 12px; margin-top: 12px; white-space: pre-wrap }
footer { text-align: center; font-size: .8rem; color: var(--muted); padding-bottom: 20px }
.login main { max-width: 440px; margin-top: 10vh }
.login .eyebrow { color: var(--teal) }
[hidden] { display: none !important }
@media (max-width: 650px) {
  .wrap { width: calc(100% - 24px) }
  .brand { padding-block: 14px }
  nav { gap: 2px; padding: 8px 0 }
  nav a { font-size: .9rem; padding: 11px 9px }
  section { margin-block: 14px; padding: 14px }
  .sectiontitle label { width: 100% }
  .sectiontitle { gap: 6px }
  .grid { grid-template-columns: 1fr }
  .toolbar { gap: 4px }
  .preference { flex-basis: auto }
  .preference[open] { flex-basis: 100% }
  .topic-row { gap: 4px }
  .topic-controls { gap: 2px }
  .preference ul { padding-inline-start: 12px }
  .news { padding: 14px }
  .actions { gap: 6px }
  .source { gap: 4px 10px }
}
