/* DeepSeek Harness light — Desktop forum */
:root {
  --bg: #FFFFFF;
  --sidebar: #F9FAFB;
  --sidebar-hover: #F1F3F5;
  --sidebar-active: #EBEEF2;
  --accent: #4176E6;
  --accent-tint: #E4EDFD;
  --bubble: #EDF3FE;
  --wash: #DBEAFE;
  --fg: #0F1115;
  --secondary: #61666B;
  --tertiary: #81858C;
  --caption: #ADB2B8;
  --border: rgba(0, 0, 0, 0.06);
  --search: #F5F6F7;
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar-w: 240px;
  --app-w: 1280px;
  --topbar-h: 64px;
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  color: var(--fg);
  font-family: var(--font);
  background: #F1F3F5;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
textarea { resize: none; }

#app {
  display: flex;
  width: 100%;
  max-width: var(--app-w);
  height: 100vh;
  min-height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 30;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 20px 18px;
}
.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.brand-sub {
  font-size: 12px;
  color: var(--caption);
  line-height: 1.4;
}

#nav-links {
  display: flex;
  flex-direction: column;
  padding: 4px 0 12px;
}
#nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 20px;
  font-size: 14px;
  color: var(--fg);
}
#nav-links a:hover { background: var(--sidebar-hover); }
#nav-links a.active {
  background: var(--accent-tint);
  font-weight: 500;
}

.sidebar-recent {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 20px 16px;
}
.sidebar-recent-label {
  font-size: 12px;
  color: var(--caption);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
#sidebar-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-link {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-link:hover { color: var(--fg); }
.recent-empty { font-size: 12px; color: var(--caption); }

.sidebar-foot {
  padding: 12px 20px 20px;
}
.sidebar-foot .btn-primary {
  width: 100%;
  height: 40px;
  border-radius: var(--radius);
}

/* Workspace */
.workspace {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  z-index: 10;
}
#page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.sort-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  white-space: nowrap;
}
.sort-links a { color: var(--secondary); }
.sort-links a:hover { color: var(--fg); }
.sort-links a.active { color: var(--accent); font-weight: 500; }
.sort-sep { color: var(--caption); user-select: none; }
.sort-links[hidden] { display: none !important; }

.search-box { margin-left: auto; }
.search-box input {
  width: 220px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: var(--search);
  padding: 8px 14px;
  color: var(--fg);
  outline: none;
}
.search-box input::placeholder { color: var(--tertiary); }
.search-box input:focus {
  box-shadow: 0 0 0 2px rgba(65, 118, 230, 0.18);
}

#auth-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.text-btn {
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  color: var(--fg);
}
.text-btn:hover { color: var(--accent); }

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  padding: 8px 7px;
  flex-direction: column;
  justify-content: space-between;
}
.menu-toggle span {
  display: block;
  height: 1.5px;
  background: var(--fg);
  border-radius: 1px;
}

#main {
  flex: 1;
  overflow-y: auto;
  padding: 12px 40px 168px;
}

/* Feed cards */
.feed { display: flex; flex-direction: column; }
.feed-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
}
.feed-card:hover { background: transparent; }
.feed-card:hover .feed-title { color: var(--accent); }
.feed-body { flex: 1; min-width: 0; }
.feed-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--fg);
  margin: 0 0 4px;
}
.feed-excerpt {
  font-size: 14px;
  line-height: 1.5;
  color: var(--secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}
.feed-meta {
  font-size: 12px;
  color: var(--caption);
  line-height: 1.5;
}
.feed-replies {
  flex-shrink: 0;
  min-width: 24px;
  text-align: right;
  font-size: 13px;
  color: var(--caption);
  padding-top: 2px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  color: var(--caption);
  font-size: 13px;
}
.page-nav { display: flex; gap: 8px; }

/* Thread */
.thread { }
.thread-title {
  margin: 8px 0 20px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.post { margin-bottom: 20px; }
.post-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-name { font-size: 14px; font-weight: 500; }
.post-role { font-size: 12px; color: var(--caption); margin-top: 1px; }
.bubble {
  background: var(--bubble);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.bubble p, .post-body p { margin: 0 0 0.6em; }
.bubble p:last-child, .post-body p:last-child { margin-bottom: 0; }
.bubble pre, .post-body pre {
  overflow: auto;
  background: rgba(15, 17, 21, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.replies-head {
  font-size: 13px;
  color: var(--secondary);
  margin: 8px 0 16px;
}
.post-reply .post-body {
  font-size: 14px;
  line-height: 1.6;
  padding-left: 46px;
  word-break: break-word;
}
.post-reply .post-user { margin-bottom: 6px; }
.post-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  padding-left: 46px;
}
.post-op .post-actions { padding-left: 0; }
.post-actions button {
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--tertiary);
}
.post-actions button:hover { color: var(--accent); }

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.user-chip .avatar { width: 28px; height: 28px; font-size: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  font-size: 14px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
}
.btn-primary:hover { background: #1a1d24; }
.btn-outline {
  border-color: var(--border);
  background: #fff;
}
.btn-outline:hover { border-color: rgba(0, 0, 0, 0.14); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; height: 40px; }

/* Dock composer */
.dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 40px 24px;
  pointer-events: none;
  z-index: 20;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 42%);
}
.composer-glow {
  position: relative;
  width: 100%;
  pointer-events: auto;
}
.composer-glow::before {
  content: "";
  position: absolute;
  inset: -28px -48px -18px;
  background:
    radial-gradient(ellipse 70% 90% at 50% 85%, rgba(237, 243, 254, 0.95) 0%, transparent 70%),
    radial-gradient(ellipse 50% 70% at 50% 100%, rgba(219, 234, 254, 0.72) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}
.composer-pill {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 28px;
  padding: 8px 8px 8px 20px;
  box-shadow:
    0 0 0 1px rgba(65, 118, 230, 0.10),
    0 8px 28px rgba(65, 118, 230, 0.14),
    0 2px 8px rgba(65, 118, 230, 0.10);
}
.composer-pill textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  min-height: 24px;
  max-height: 96px;
  padding: 6px 0;
  line-height: 1.5;
  font-size: 14px;
}
.composer-pill textarea::placeholder { color: var(--tertiary); }
.dock-send {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dock-send:hover { filter: brightness(1.06); }
.dock-send:disabled { opacity: 0.55; }

.composer-pill.expanded {
  align-items: flex-end;
}
.composer-pill.expanded textarea {
  min-height: 96px;
  max-height: 140px;
}
.composer-pill.previewing textarea { display: none; }
.composer-meta {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 8px 8px;
  pointer-events: auto;
}
.composer-meta .hint { flex: 1; }
.composer-meta .text-btn {
  font-size: 12px;
  color: var(--tertiary);
}
.composer-meta .text-btn.active { color: var(--accent); }
.dock-preview {
  flex: 1;
  min-height: 96px;
  max-height: 140px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.55;
  padding: 6px 0;
  word-break: break-word;
}

.post-like.active { color: #4176E6; }
.post-edit { display: grid; gap: 8px; }
.post-edit-area {
  width: 100%;
  min-height: 96px;
  border: none;
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
  outline: none;
  box-shadow: 0 0 0 2px rgba(65, 118, 230, 0.18);
  resize: vertical;
}
.post-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.composer-tabs {
  display: flex;
  gap: 16px;
}
.composer-tab {
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--tertiary);
}
.composer-tab.active { color: var(--accent); font-weight: 500; }
.composer-preview {
  min-height: 120px;
  border-radius: var(--radius);
  background: var(--search);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.composer-preview code,
.dock-preview code,
.bubble code,
.post-body code {
  background: rgba(15, 17, 21, 0.06);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
}
.composer-preview pre,
.dock-preview pre {
  overflow: auto;
  background: rgba(15, 17, 21, 0.04);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.composer-preview pre code,
.dock-preview pre code {
  background: none;
  padding: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  z-index: 80;
}
.modal {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  gap: 20px;
  box-shadow: 0 24px 64px rgba(15, 17, 21, 0.12);
}
.modal.wide { width: min(560px, 100%); }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.modal-title-col { display: grid; gap: 6px; }
.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.modal-desc {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.6;
}
.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; color: var(--secondary); }
.field input,
.field textarea {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--search);
  padding: 12px 14px;
  outline: none;
  color: var(--fg);
}
.field textarea { min-height: 140px; }
.field textarea.composer-textarea { min-height: 120px; }
.field input:focus,
.field textarea:focus {
  box-shadow: 0 0 0 2px rgba(65, 118, 230, 0.18);
  background: #fff;
}
.form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.form-alt {
  text-align: center;
  color: var(--tertiary);
  font-size: 13px;
}
.form-alt a { color: var(--fg); font-weight: 500; }
.board-options { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--secondary);
  font-size: 13px;
  background: #fff;
}
.chip-active {
  background: var(--accent-tint);
  border-color: transparent;
  color: var(--accent);
}
.hint { color: var(--caption); font-size: 12px; }
.error-text { color: #b42318; font-size: 13px; }
.empty {
  border: 1px dashed rgba(0, 0, 0, 0.10);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--tertiary);
  background: #fff;
}
.page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 4px 20px;
  margin-bottom: 4px;
}
.page-hero-copy h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.page-hero-copy p {
  margin: 0;
  font-size: 14px;
  color: var(--secondary);
  line-height: 1.55;
}
.page-hero .btn { flex-shrink: 0; }
.chip-locked,
.chip:disabled {
  opacity: 0.85;
  cursor: default;
}
.empty .empty-cta { margin-top: 16px; }
.loading {
  padding: 48px;
  text-align: center;
  color: var(--tertiary);
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 100;
  display: grid;
  gap: 8px;
  justify-items: center;
  width: min(var(--app-w), calc(100% - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--fg);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(15, 17, 21, 0.18);
  max-width: 360px;
}
.toast.error { background: #b42318; }


.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}
.avatar.profile-avatar { width: 64px; height: 64px; font-size: 24px; }
a.user-chip:hover { color: var(--accent); }

.bell-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.bell-btn:hover { color: var(--accent); }
.bell-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #E5484D;
  box-shadow: 0 0 0 2px #fff;
}

.unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}
.mini-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--accent-tint);
  color: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}
.mini-chip.lock {
  background: var(--search);
  color: var(--secondary);
}

.thread-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}
.thread-toolbar .btn { height: 32px; font-size: 13px; }

.page-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 12px;
}

.notif-list { display: flex; flex-direction: column; }
.notif-row { border-bottom: 1px solid var(--border); }
.notif-row > a,
.notif-row > .notif-main {
  display: block;
  padding: 14px 4px;
}
.notif-row.unread .notif-text { font-weight: 500; }
.notif-text { font-size: 14px; line-height: 1.5; }
.notif-meta { font-size: 12px; color: var(--caption); margin-top: 4px; }
.notif-row:hover .notif-text { color: var(--accent); }

.profile-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 8px 0 20px;
}
.profile-name { font-size: 18px; font-weight: 600; }
.profile-uname { font-size: 13px; color: var(--tertiary); margin-top: 2px; }
.profile-stats { font-size: 13px; color: var(--secondary); margin-top: 8px; }
.profile-settings {
  background: var(--search);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.profile-settings-title { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.post-name a:hover { color: var(--accent); }

.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  body { overflow: auto; display: block; background: var(--bg); }
  #app { height: auto; min-height: 100vh; max-width: none; flex-direction: column; border: none; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(15, 17, 21, 0.10);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 21, 0.28);
    z-index: 25;
  }
  .sidebar-backdrop[hidden] { display: none; }
  .workspace { height: auto; min-height: 100vh; }
  .topbar { padding: 0 16px; gap: 10px; }
  .menu-toggle { display: flex; }
  #page-title { font-size: 16px; }
  .sort-links { display: flex; font-size: 13px; }
  .search-box { margin-left: 0; }
  .search-box input { width: min(160px, 36vw); }
  #main { padding: 8px 16px 120px; }
  .dock { padding: 8px 16px 16px; }
  .composer-glow::before { inset: -16px -20px -12px; }
  .thread-title { font-size: 18px; }
  .post-reply .post-body { padding-left: 0; }
}

.composer-meta-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.composer-preview img,
.dock-preview img,
.bubble img,
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}
.composer-textarea.drag-over,
#dock-input.drag-over {
  box-shadow: 0 0 0 2px rgba(65, 118, 230, 0.28);
}
