
  :root {
    --fg: #1f2328;
    --muted: #656d76;
    --line: #d8dee4;
    --accent: #0969da;
    --accent-dark: #0550ae;
    --bg: #f6f8fa;
    --card: #ffffff;
    --danger: #cf222e;
    --danger-bg: #ffebe9;
    --radius: 8px;
  }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
  }
  a { color: var(--accent); text-decoration: none; }
  a:hover { color: var(--accent-dark); text-decoration: underline; }
  .wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

  .site-header { background: var(--card); border-bottom: 1px solid var(--line); }
  .header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 52px; gap: 12px; }
  .brand { font-size: 18px; font-weight: 700; color: var(--fg); }
  .brand:hover { text-decoration: none; }
  .nav { display: flex; align-items: center; gap: 12px; font-size: 14px; }
  .nav-user { display: inline-flex; align-items: center; gap: 10px; }
  .nav-username { font-weight: 600; color: var(--fg); }
  .inline-form { display: inline; margin: 0; }

  main.wrap { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }
  footer.wrap { text-align: center; color: var(--muted); font-size: 13px; padding-bottom: 24px; }

  .toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .toolbar h1 { font-size: 20px; margin: 0; }

  .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 12px;
  }
  .empty { color: var(--muted); text-align: center; }

  .btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 14px;
    cursor: pointer;
    background: var(--card);
    color: var(--fg);
    text-decoration: none;
    line-height: 1.5;
  }
  .btn:hover { text-decoration: none; }
  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover { background: var(--accent-dark); color: #fff; }
  .btn-ghost { border-color: var(--line); }
  .btn-ghost:hover { background: #f3f4f6; }
  .btn-sm { padding: 3px 10px; font-size: 13px; }
  .btn-danger-ghost { border-color: var(--danger); color: var(--danger); }
  .btn-danger-ghost:hover { background: var(--danger-bg); color: var(--danger); }

  .topic-title { margin: 0 0 4px; font-size: 17px; }
  .topic-title a { color: var(--fg); }
  .topic-title a:hover { color: var(--accent); }
  .topic-excerpt { margin: 6px 0 8px; color: #444c56; font-size: 14px; white-space: pre-line; }
  .meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

  .post-content { white-space: pre-wrap; word-break: break-word; }
  .reply-list { margin-top: 4px; }
  .reply-item { padding: 12px 0; border-top: 1px solid var(--line); }
  .reply-item:first-of-type { border-top: none; }
  .reply-body { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }

  .alert { padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
  .alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #ffcecb; }
  .alert-info { background: #ddf4ff; color: #0550ae; border: 1px solid #b6e3ff; }

  .auth-card { max-width: 380px; margin: 32px auto; }
  .auth-card h1 { font-size: 20px; margin: 0 0 4px; }
  .auth-hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
  .form-row { margin-bottom: 14px; }
  .form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
  .form-row input[type="text"],
  .form-row input[type="password"],
  .form-row input:not([type]),
  .form-row textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--card);
    color: var(--fg);
  }
  .form-row textarea { min-height: 140px; resize: vertical; }
  .form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15); }
  .form-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
  .form-switch { font-size: 13.5px; color: var(--muted); }

  .profile-head { display: flex; gap: 16px; align-items: center; padding: 18px; }
  .avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; flex: none;
  }
  .profile-name { font-size: 22px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 10px; }
  .badge-self { font-size: 12px; font-weight: 500; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }
  .profile-meta { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
  .stats { display: flex; gap: 0; border-top: 1px solid var(--line); }
  .stat { flex: 1; text-align: center; padding: 12px 0; border-right: 1px solid var(--line); }
  .stat:last-child { border-right: none; }
  .stat-num { font-size: 20px; font-weight: 700; }
  .stat-label { font-size: 12.5px; color: var(--muted); }
  .section-title { font-size: 16px; margin: 20px 0 10px; }
  .reply-item-title { margin: 0 0 4px; font-size: 14.5px; }

  .pagination { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 16px 0 4px; }

  .toolbar-actions { display: flex; align-items: center; gap: 8px; }
  .btn-danger { background: var(--danger); color: #fff; }
  .btn-danger:hover { background: #a40e26; color: #fff; }
  .badge-owner { font-size: 12px; font-weight: 500; color: #9a6700; border: 1px solid #d4a72c; border-radius: 999px; padding: 1px 8px; background: #fff8c5; }
  .badge-admin { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; background: var(--bg); }
