/* forum.css — 复用 paste.sh 风格 */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: .6em;
  padding-top: .4em;
  background: #eee;
  font-family: Consolas, Monaco, "Lucida Console", "Liberation Mono",
               "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace;
  font-size: small;
  color: #333;
}

a { color: #254B85; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
#header {
  display: flex;
  align-items: baseline;
  gap: .6em;
  margin-bottom: .5em;
  flex-wrap: wrap;
}
#header .logo {
  font-size: 120%;
  font-weight: bold;
  color: #555;
}
#header .breadcrumb { color: #aaa; font-size: 90%; }
#header .breadcrumb a { color: #777; }
#header .actions { margin-left: auto; }
#header .actions a {
  color: #aaa;
  margin-left: .8em;
}

/* ── Board list ── */
.board-list { margin-top: .5em; }
.board-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: .6em .9em;
  margin-bottom: .4em;
  display: flex;
  align-items: center;
  gap: .8em;
}
.board-card:hover { border-color: #aaa; }
.board-card .board-name { font-weight: bold; font-size: 105%; }
.board-card .board-sub  { color: #888; font-size: 90%; }
.board-card .board-arrow { margin-left: auto; color: #bbb; }

/* ── Thread list ── */
.thread-list { margin-top: .5em; }
.thread-row {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: .5em .9em;
  margin-bottom: .35em;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3em .8em;
  align-items: center;
}
.thread-row:hover { border-color: #aaa; }
.thread-title { font-weight: bold; color: #254B85; }
.thread-title:hover { text-decoration: underline; cursor: pointer; }
.thread-meta { color: #999; font-size: 85%; grid-column: 1; }
.thread-stats { color: #bbb; font-size: 85%; text-align: right; white-space: nowrap; }

/* ── Thread view ── */
.post-box {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: .7em .9em;
  margin-bottom: .5em;
}
.post-box.op { border-left: 3px solid #254B85; }
.post-box.reply { border-left: 3px solid #ccc; }
.post-header {
  display: flex;
  align-items: baseline;
  gap: .6em;
  margin-bottom: .4em;
  flex-wrap: wrap;
}
.post-id    { color: #aaa; font-size: 85%; }
.post-time  { color: #bbb; font-size: 85%; }
.post-quote-btn {
  margin-left: auto;
  color: #aaa;
  cursor: pointer;
  font-size: 85%;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}
.post-quote-btn:hover { color: #254B85; }
.post-title { font-weight: bold; font-size: 110%; margin-bottom: .3em; }
.post-body {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.4em;
  color: #333;
}
.post-body.loading { color: #bbb; font-style: italic; }
.post-body.error   { color: #c00; }

.quote-block {
  border-left: 2px solid #ccc;
  padding-left: .6em;
  margin-bottom: .5em;
  color: #888;
  font-size: 90%;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Reply form ── */
#reply-form {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: .7em .9em;
  margin-top: .5em;
}
#reply-form h3 { margin: 0 0 .4em; color: #555; font-size: 100%; }
#reply-quote-preview {
  display: none;
  border-left: 2px solid #aaa;
  padding-left: .6em;
  margin-bottom: .4em;
  color: #888;
  font-size: 90%;
  white-space: pre-wrap;
  word-break: break-word;
}
#reply-quote-preview.visible { display: block; }
#reply-quote-clear {
  color: #bbb;
  cursor: pointer;
  font-size: 85%;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  display: block;
  margin-bottom: .3em;
}
#reply-quote-clear:hover { color: #c00; }

#new-thread-form {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: .7em .9em;
  margin-top: .5em;
}
#new-thread-form h3 { margin: 0 0 .4em; color: #555; font-size: 100%; }

label { display: block; color: #777; margin-bottom: .15em; font-size: 90%; }
input[type=text], select, textarea.compose {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: .4em .6em;
  font-family: inherit;
  font-size: inherit;
  background: white;
  color: #333;
  margin-bottom: .5em;
}
input[type=text]:focus, select:focus, textarea.compose:focus {
  outline: none;
  border-color: #aaa;
}
textarea.compose {
  min-height: 8em;
  resize: vertical;
}
.btn {
  background: #254B85;
  color: white;
  border: none;
  border-radius: 5px;
  padding: .35em .9em;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}
.btn:hover { background: #1a3a6a; }
.btn:disabled { background: #aaa; cursor: default; }
.btn-secondary {
  background: none;
  color: #777;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: .35em .9em;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  margin-left: .4em;
}
.btn-secondary:hover { border-color: #aaa; color: #333; }

#status-msg {
  color: #aaa;
  font-size: 90%;
  margin-top: .3em;
  min-height: 1.2em;
}
#status-msg.error { color: #c00; }

/* ── Empty state ── */
.empty { color: #bbb; padding: 1em 0; text-align: center; }

/* ── Controls bar (bottom, like paste.sh) ── */
#controls {
  color: #aaa;
  position: fixed;
  bottom: .4em;
  right: 1.25em;
}
#controls a { color: #aaa; margin-left: .6em; }

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
  body { background: #222; color: #ccc; }
  a { color: #8ab4f8; }
  .board-card, .thread-row, .post-box, #reply-form, #new-thread-form {
    background: #111;
    border-color: #444;
    color: #ccc;
  }
  .thread-title { color: #8ab4f8; }
  .post-body { color: #ddd; }
  input[type=text], select, textarea.compose {
    background: #1a1a1a;
    border-color: #444;
    color: #ddd;
  }
  input[type=text]:focus, select:focus, textarea.compose:focus { border-color: #666; }
  .btn { background: #1a3a6a; }
  .btn:hover { background: #254B85; }
  .btn-secondary { border-color: #444; color: #aaa; }
  .btn-secondary:hover { border-color: #666; color: #ccc; }
  #controls a { color: #666; }
  #header .logo { color: #aaa; }
}

@media only screen and (max-width: 600px) {
  body { padding: .4em; }
  .thread-row { grid-template-columns: 1fr; }
  .thread-stats { text-align: left; }
}
