* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #0b5394;
  --blue-dark: #083b6b;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #222;
  --muted: #6b7280;
  --border: #e5e7eb;
}
body { font-family: "Segoe UI", Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
.brand { font-size: 20px; font-weight: 800; color: var(--blue); }
.brand span { color: #e8462c; }

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: var(--card); width: 360px; max-width: 92vw; padding: 32px 28px;
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.login-card h1 { font-size: 20px; margin-top: 10px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.login-card input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--blue); }
.login-card button {
  width: 100%; margin-top: 20px; padding: 12px; background: var(--blue);
  color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.login-card button:hover { background: var(--blue-dark); }
.error { color: #c0392b; font-size: 13px; margin-top: 12px; min-height: 16px; }

/* ---------- App shell ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { color: var(--muted); font-size: 13px; }
.btn-ghost { background: none; border: 1px solid var(--border); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-ghost:hover { background: #f3f4f6; }

.layout { display: flex; gap: 18px; padding: 18px; align-items: flex-start; }
.sidebar { width: 240px; flex-shrink: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sidebar-head { padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--border); background: #fafafa; }
.history-list { list-style: none; max-height: 70vh; overflow-y: auto; }
.history-list li {
  padding: 10px 14px; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
}
.history-list li:hover { background: #f5f8fc; }
.history-list li.active { background: #eaf2fb; }
.history-list .hdate { font-weight: 600; }
.history-list .hcount { color: var(--muted); font-size: 11px; }
.history-list .empty { color: var(--muted); cursor: default; }

.content { flex: 1; min-width: 0; }
.actions { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.btn-primary { background: var(--blue); color: #fff; border: none; padding: 11px 18px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-secondary { background: #10863f; color: #fff; border: none; padding: 11px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-secondary:disabled { background: #b8c2ba; cursor: default; }
.status { color: var(--muted); font-size: 13px; }
.meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; min-height: 16px; }
.badge { display: inline-block; background: #eef6ee; color: #10863f; border-radius: 20px; padding: 2px 10px; font-weight: 600; margin-left: 6px; }
.badge.kw { background: #fdf1e6; color: #b45309; }

.bulletin { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 24px; min-height: 300px; }
.bulletin .empty { color: var(--muted); text-align: center; padding: 60px 20px; line-height: 1.6; }
.bulletin .title { color: var(--blue); font-size: 22px; margin: 8px 0 6px; }
.bulletin .src { color: var(--blue); font-size: 17px; border-bottom: 2px solid var(--blue); padding-bottom: 4px; margin: 20px 0 10px; }
.bulletin .hl { margin: 0 0 9px 22px; text-indent: -16px; line-height: 1.5; }
.bulletin .hl:before { content: "📝  "; }
.bulletin .intro { margin: 5px 0; font-size: 14px; color: #333; line-height: 1.5; }
.bulletin .intro a { color: #1155cc; text-decoration: none; word-break: break-all; }
.bulletin .footer { font-weight: 700; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
