:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e3e8ef;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: #eef4ff;
  --sidebar: #0f172a;
  --sidebar-2: #162033;
  --sidebar-text: #dbe4f0;
  --sidebar-muted: #8fa1b8;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --danger: #b91c1c;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- login ---------- */
.login-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(37, 99, 235, .16), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(14, 165, 233, .12), transparent 60%),
    linear-gradient(135deg, #f8fafc, #eef3fb);
}
.login-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 38px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(145deg, #2563eb, #1e40af);
  color: #fff; font-weight: 800; letter-spacing: .5px; font-size: 14px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .3);
}
.brand-mark.small { width: 36px; height: 36px; border-radius: 10px; font-size: 11px; box-shadow: none; }
.brand-word { font-weight: 700; letter-spacing: .2px; color: #334155; }
.login-card h1 { font-size: 28px; line-height: 1.25; margin: 0 0 12px; letter-spacing: -.4px; }
.login-card > p { margin: 0 0 26px; line-height: 1.7; }
.login-form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: #334155; }
input, textarea, select {
  width: 100%;
  border: 1px solid #cfd8e5;
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
textarea { resize: vertical; line-height: 1.6; }
.primary {
  border: 0; border-radius: 10px; padding: 11px 18px;
  background: var(--accent); color: #fff; font-weight: 650;
}
.primary:hover { background: var(--accent-2); }
.ghost-btn, .text-btn, .icon-btn {
  border: 1px solid var(--line); background: #fff; color: #334155;
  border-radius: 9px; padding: 8px 12px;
}
.ghost-btn:hover, .text-btn:hover, .icon-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.icon-btn { padding: 6px 9px; line-height: 1; }
.icon-btn.small { padding: 3px 8px; font-size: 16px; }
.text-btn { border-color: transparent; background: transparent; color: var(--muted); padding: 5px 7px; }
.text-btn:hover { color: var(--text); background: #f1f5f9; }
.form-error { color: var(--danger); background: #fef2f2; border: 1px solid #fecaca; padding: 9px 11px; border-radius: 8px; font-size: 13px; margin: 0; }
.login-foot { text-align: center; font-size: 12px; color: #94a3b8; margin: 22px 0 0 !important; }

/* ---------- layout ---------- */
.app-shell { height: 100%; display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.sidebar {
  min-width: 0; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 14px 14px; color: var(--sidebar-text);
  background: linear-gradient(180deg, var(--sidebar), #0b1322);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; }
.sidebar-head strong { display: block; font-size: 14px; }
.sidebar-sub { font-size: 11px; color: var(--sidebar-muted); margin-top: 2px; }
.me-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; background: rgba(255,255,255,.04);
}
.me-meta { min-width: 0; flex: 1; }
.me-meta strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-meta span { display: block; color: var(--sidebar-muted); font-size: 11px; margin-top: 2px; }
.me-avatar { background: #334155; color: #fff; }
.me-card .text-btn { color: var(--sidebar-muted); }
.me-card .text-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.avatar {
  width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: #64748b;
  overflow: hidden; line-height: 1;
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.sidebar-section { min-height: 0; display: flex; flex-direction: column; gap: 5px; }
.members-section { flex: 1; overflow: auto; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 7px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sidebar-muted);
}
.section-title .icon-btn { background: transparent; border-color: transparent; color: var(--sidebar-muted); }
.section-title .icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.channel-list { display: grid; gap: 3px; max-height: 38vh; overflow: auto; }
.channel-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; border-radius: 9px; padding: 8px 9px; text-align: left;
  color: var(--sidebar-text); background: transparent; font-size: 13px;
}
.channel-item:hover { background: rgba(255,255,255,.07); }
.channel-item.active { background: rgba(37, 99, 235, .28); color: #fff; }
.channel-item .hash { color: var(--sidebar-muted); font-weight: 700; }
.channel-item.active .hash { color: #bfdbfe; }
.channel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #2563eb; color: #fff; font-size: 10px; font-weight: 800;
}
.badge.zero { display: none; }
.member-list { display: grid; gap: 2px; }
.member-item { display: flex; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 8px; font-size: 12px; }
.member-item:hover { background: rgba(255,255,255,.05); }
.member-item .avatar { width: 24px; height: 24px; border-radius: 8px; font-size: 10px; }
.member-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-role { margin-left: auto; color: var(--sidebar-muted); font-size: 10px; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 0; border-top: 1px solid rgba(255,255,255,.07); color: var(--sidebar-muted); }
.connection-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #a7f3d0; }
.connection-status i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.12); }
.connection-status.offline { color: #fecaca; }
.connection-status.offline i { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.12); }

/* ---------- main ---------- */
.main { min-width: 0; height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 13px 22px;
  background: rgba(255,255,255,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
}
.channel-heading { min-width: 0; flex: 1; }
.channel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-heading p { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 6px; }
.mobile-only { display: none; }
.prompt-banner {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  margin: 10px 22px 0; padding: 9px 12px;
  background: var(--warning-soft); border: 1px solid #fed7aa; border-radius: 10px;
  color: var(--warning); font-size: 13px; font-weight: 600;
}
.prompt-banner .text-btn { color: var(--warning); }
.message-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 26px;
  scroll-behavior: smooth;
}
.message-list:empty::before {
  content: "还没有消息。发一条，或者上传一个文件。";
  display: block; color: #94a3b8; text-align: center; padding: 56px 12px; font-size: 13px;
}
.message-row {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px;
  max-width: 940px; margin: 0 auto; padding: 8px 10px; border-radius: 12px;
}
.message-row:hover { background: rgba(255,255,255,.6); }
.message-row.own { background: rgba(238, 244, 255, .55); }
.message-main { min-width: 0; }
.message-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.message-author { font-weight: 700; font-size: 13px; }
.message-time { color: #94a3b8; font-size: 11px; }
.message-target { color: #7c3aed; background: #f5f3ff; border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-size: 14px; color: #1f2937; }
.message-row.own .message-text { color: #172554; }
.prompt-card {
  margin-top: 4px; border: 1px solid #ddd6fe; background: #faf5ff;
  border-radius: 13px; padding: 13px 14px;
}
.prompt-card.acked { opacity: .66; }
.prompt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.prompt-label { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: #7c3aed; }
.prompt-to { font-size: 12px; color: #6d28d9; font-weight: 650; }
.prompt-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 13px; color: #2e1065; }
.prompt-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.prompt-actions button { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.prompt-acked { font-size: 12px; color: #047857; }
.file-card { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; max-width: 100%; }
.file-card:hover { border-color: #bfdbfe; background: #f8fbff; }
.file-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #eef2ff; color: #4338ca; font-size: 15px; }
.file-meta { min-width: 0; }
.file-name { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.file-size { color: var(--muted); font-size: 11px; }
.file-image { margin-top: 8px; display: block; max-width: min(420px, 100%); max-height: 280px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.message-empty { color: var(--muted); text-align: center; padding: 30px; font-size: 13px; }

/* ---------- composer ---------- */
.composer {
  margin: 0 22px 16px; padding: 10px 12px 9px;
  background: #fff; border: 1px solid #cfd8e5; border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
  display: flex; flex-direction: column; gap: 6px;
}
.composer:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(37,99,235,.08), 0 10px 30px rgba(15,23,42,.07); }
.composer textarea {
  border: 0; box-shadow: none; padding: 4px 4px 0; resize: none;
  min-height: 38px; max-height: 180px; background: transparent; font-size: 14px;
}
.composer textarea:focus { box-shadow: none; }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.attach-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; color: #475569; }
.attach-btn:hover { background: #f1f5f9; }
.attach-btn span { font-size: 17px; }
.composer-hint { margin-left: auto; }
.upload-status { color: var(--accent); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-btn { padding: 8px 18px; }
.ghost-btn { background: #fff; }

/* ---------- dialog ---------- */
.dialog {
  width: min(560px, calc(100vw - 28px)); border: 0; border-radius: 18px;
  padding: 0; box-shadow: var(--shadow); color: var(--text);
}
.dialog::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.dialog form { padding: 20px 22px 18px; display: grid; gap: 14px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h3 { margin: 0; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.dialog .muted { margin: 0; line-height: 1.6; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; z-index: 100; box-shadow: 0 12px 34px rgba(15,23,42,.25);
  max-width: min(520px, calc(100vw - 28px));
}

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); z-index: 40;
    transform: translateX(-105%); transition: transform .18s ease;
    box-shadow: 18px 0 50px rgba(15,23,42,.28);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(15,23,42,.36); }
  .sidebar-backdrop[hidden] { display: none !important; }
  .mobile-only { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  .message-list { padding: 12px 10px 20px; }
  .message-row { grid-template-columns: 32px minmax(0,1fr); padding: 7px 7px; gap: 8px; }
  .composer { margin: 0 10px 10px; padding: 8px 10px 8px; }
  .composer-hint { display: none; }
  .channel-heading h2 { font-size: 15px; }
  .prompt-banner { margin: 8px 10px 0; }
}

/* ===================== 头像 / 在线状态 / 成员 ===================== */
.me-avatar-wrap,
.member-avatar-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.presence-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #94a3b8; border: 2px solid var(--sidebar);
}
.presence-dot.online { background: #34d399; box-shadow: 0 0 0 2px rgba(52, 211, 153, .18); }
.me-actions { display: flex; flex-direction: column; gap: 1px; margin-left: auto; }
.me-actions .text-btn { padding: 2px 5px; font-size: 10px; border-radius: 6px; line-height: 1.5; }

.member-list { min-height: 0; }
.member-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 7px; border: 0; border-radius: 8px; background: transparent;
  color: var(--sidebar-text); font: inherit; font-size: 12px; text-align: left;
}
.member-item:hover { background: rgba(255, 255, 255, .07); }
.member-item:focus-visible { outline: 2px solid #60a5fa; outline-offset: -2px; }
.member-item .avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }
.member-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.member-line { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.member-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.member-sub {
  color: var(--sidebar-muted); font-size: 10px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member-tag {
  flex: 0 0 auto; border-radius: 999px; padding: 0 5px;
  font-size: 9px; font-weight: 700; line-height: 15px; letter-spacing: .02em;
}
.tag-exit { color: #bfdbfe; background: rgba(37, 99, 235, .35); }
.tag-admin { color: #fde68a; background: rgba(180, 83, 9, .35); }
.drive-link { color: #93c5fd; font-size: 11px; }

/* ===================== 频道 tabs / 归档 ===================== */
.channel-tabs {
  display: flex; gap: 4px; padding: 0 22px;
  background: rgba(255, 255, 255, .86); border-bottom: 1px solid var(--line);
}
.channel-tabs .tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 9px 12px 8px; font-size: 13px; font-weight: 600;
  border-bottom: 2px solid transparent; border-radius: 0;
}
.channel-tabs .tab:hover { color: var(--text); }
.channel-tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.archive-view {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px 22px 26px;
  display: flex; flex-direction: column; gap: 12px;
}
.archive-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.archive-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px; align-content: start;
}
.archive-card {
  margin: 0; min-width: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.archive-card:hover { border-color: #bfdbfe; box-shadow: 0 8px 22px rgba(15, 23, 42, .07); }
.archive-image-btn {
  display: block; width: 100%; padding: 0; border: 0; background: #f1f5f9;
  aspect-ratio: 4 / 3; cursor: zoom-in; overflow: hidden;
}
.archive-image-btn:disabled { cursor: default; opacity: 1; }
.archive-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.archive-image-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 12px; text-align: center;
  color: var(--muted); font-size: 12px; line-height: 1.5;
}
.archive-caption { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.archive-name {
  font-size: 12px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.archive-meta { color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-download { font-size: 11px; align-self: flex-start; margin-top: 2px; }
.file-archive-card {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  color: var(--text); background: #fff;
}
.file-archive-card:hover { text-decoration: none; }
.archive-file-icon {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px;
  display: grid; place-items: center; background: #eef2ff; font-size: 18px;
}
.archive-file-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.archive-file-action { flex: 0 0 auto; color: var(--accent); font-size: 11px; font-weight: 650; }
.archive-empty {
  margin: 30px auto; max-width: 420px; text-align: center; line-height: 1.7;
  color: var(--muted); font-size: 13px; padding: 22px;
  border: 1px dashed #cbd5e1; border-radius: 14px; background: rgba(255, 255, 255, .6);
}
.archive-foot { display: flex; justify-content: center; padding: 6px 0 2px; }

/* 聊天里的图片与文件 */
.file-wrap { margin-top: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.file-image-btn {
  padding: 0; border: 0; background: transparent; cursor: zoom-in;
  max-width: min(420px, 100%); display: block; border-radius: 12px;
}
.file-image {
  display: block; max-width: min(420px, 100%); max-height: 300px;
  border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: #fff;
}
.file-image-broken {
  margin-top: 8px; padding: 14px 16px; border: 1px dashed #cbd5e1;
  border-radius: 10px; color: var(--muted); font-size: 12px;
}
.load-earlier { display: flex; justify-content: center; padding: 4px 0 12px; }
.load-earlier button { font-size: 12px; padding: 5px 12px; }

/* ===================== 上传进度 ===================== */
.upload-panel {
  margin: 0 22px 8px; padding: 8px 10px; max-height: 168px; overflow-y: auto;
  display: grid; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.upload-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "info actions" "bar bar";
  gap: 5px 10px; align-items: center;
}
.upload-info { grid-area: info; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.upload-name {
  font-size: 12px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.upload-detail { color: var(--muted); font-size: 11px; flex: 0 0 auto; }
.upload-actions { grid-area: actions; display: flex; gap: 2px; }
.upload-actions .text-btn { font-size: 11px; padding: 3px 6px; }
.upload-bar { grid-area: bar; height: 5px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.upload-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: inherit;
  transition: width .18s ease;
}

/* ===================== 任务板 ===================== */
.dialog { max-height: calc(100vh - 32px); }
.task-dialog {
  width: min(1120px, calc(100vw - 28px)); max-height: 90vh;
  overflow: hidden;
}
.task-dialog-inner {
  padding: 16px 18px 18px; display: flex; flex-direction: column;
  gap: 12px; max-height: 90vh; min-height: 0;
}
.task-dialog .dialog-head { align-items: flex-start; }
.task-dialog .dialog-head h3 { margin-bottom: 2px; }
.dialog-head-actions { display: flex; align-items: center; gap: 8px; }
.dialog-head-actions .primary { padding: 7px 13px; font-size: 12px; }
.task-board {
  flex: 1; min-height: 0; overflow: auto; display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px; align-items: start; padding-bottom: 4px;
}
.task-column { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 13px; padding: 9px; min-width: 0; }
.task-column-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.task-column-title { font-size: 12px; font-weight: 700; letter-spacing: .03em; color: #334155; }
.task-count {
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e2e8f0; color: #475569; font-size: 10px; font-weight: 700;
}
.task-column-body { display: grid; gap: 8px; }
.task-empty {
  padding: 16px 8px; text-align: center; color: #94a3b8; font-size: 11.5px;
  border: 1px dashed #cbd5e1; border-radius: 9px;
}
.task-card {
  display: grid; gap: 7px; padding: 9px 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  min-width: 0; transition: border-color .15s, box-shadow .15s;
}
.task-card:hover { border-color: #93c5fd; box-shadow: 0 6px 16px rgba(15, 23, 42, .08); }
.task-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.task-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.task-priority {
  border-radius: 999px; padding: 1px 7px; font-size: 9.5px; font-weight: 800;
  letter-spacing: .03em; border: 1px solid transparent;
}
.priority-low { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
.priority-normal { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.priority-high { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.priority-urgent { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.task-due { color: var(--muted); font-size: 10.5px; }
.task-due.overdue { color: var(--danger); font-weight: 700; }
.task-card-title { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.task-card-desc {
  margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-assignee { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; color: #475569; }
.task-assignee-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.tiny { width: 18px; height: 18px; border-radius: 6px; font-size: 8px; }
.task-unassigned { font-size: 11px; color: #94a3b8; }
.task-progress-row { display: flex; align-items: center; gap: 7px; }
.task-progress { flex: 1; height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.task-progress-fill { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: inherit; }
.task-progress-label { flex: 0 0 auto; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.task-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.task-status-select {
  width: auto; max-width: 110px; padding: 3px 6px; font-size: 11px;
  border-radius: 7px; border-color: #cbd5e1;
}
.task-edit-hint { color: #94a3b8; font-size: 9.5px; }

.dialog-body { padding: 20px 22px 18px; display: grid; gap: 14px; overflow-y: auto; max-height: calc(90vh - 20px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.range-field output { color: var(--accent); font-variant-numeric: tabular-nums; }
.range-field input[type="range"] { padding: 0; border: 0; box-shadow: none; accent-color: var(--accent); background: transparent; }
.danger-btn {
  border: 1px solid #fecaca; background: #fef2f2; color: var(--danger);
  border-radius: 9px; padding: 8px 12px; font-weight: 600;
}
.danger-btn:hover { background: #fee2e2; }
.dialog-actions .spacer { flex: 1; }

/* ===================== 成员详情 ===================== */
.member-dialog { width: min(480px, calc(100vw - 28px)); }
.member-detail-head { display: flex; align-items: center; gap: 12px; }
.member-detail-avatar { width: 54px; height: 54px; border-radius: 16px; font-size: 17px; }
.member-detail-id { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.member-detail-id strong { font-size: 16px; overflow-wrap: anywhere; }
.detail-list { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.detail-list dt { color: var(--muted); font-size: 12px; }
.detail-list dd { margin: 0; font-size: 12.5px; overflow-wrap: anywhere; }

/* ===================== Lightbox ===================== */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: #e2e8f0;
}
.lightbox::backdrop { background: rgba(2, 6, 23, .9); }
.lightbox-inner {
  height: 100%; display: flex; flex-direction: column;
  padding: 14px 18px 10px; background: rgba(2, 6, 23, .55);
}
.lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lightbox-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lightbox-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lightbox-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.lightbox-actions .ghost-btn { color: #e2e8f0; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); }
.lightbox-actions .ghost-btn:hover { background: rgba(255, 255, 255, .18); text-decoration: none; }
.lightbox-actions .icon-btn { color: #e2e8f0; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); }
.lightbox-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 8px 0;
}
.lightbox-stage img {
  max-width: calc(100% - 104px); max-height: 100%; object-fit: contain;
  border-radius: 8px; background: rgba(255, 255, 255, .04);
}
.lightbox-nav {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  font-size: 22px; line-height: 1; color: #e2e8f0;
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25);
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .2); }
.lightbox-foot { text-align: center; padding: 2px 0 4px; }
.lightbox .muted { color: #94a3b8; }

/* ===================== 移动端 760px ===================== */
@media (max-width: 760px) {
  .channel-tabs { padding: 0 10px; }
  .channel-tabs .tab { padding: 8px 10px 7px; font-size: 12.5px; }
  .archive-view { padding: 12px 10px 18px; }
  .archive-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 9px; }
  .upload-panel { margin: 0 10px 8px; padding: 7px 8px; max-height: 140px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .ghost-btn { padding: 7px 9px; font-size: 12px; }
  .topbar-actions .text-btn { font-size: 12px; }
  .task-dialog { width: calc(100vw - 12px); max-height: 94vh; }
  .task-dialog-inner { padding: 12px 10px 12px; max-height: 94vh; }
  .task-board { grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 9px; }
  .task-column { padding: 7px; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-body { padding: 16px 16px 14px; }
  .member-dialog { width: calc(100vw - 16px); }
  .detail-list { grid-template-columns: 76px minmax(0, 1fr); }
  .lightbox-inner { padding: 10px 10px 6px; }
  .lightbox-stage img { max-width: calc(100% - 88px); }
  .lightbox-nav { width: 32px; height: 32px; font-size: 18px; }
  .file-image { max-height: 220px; }
  .archive-image-btn { aspect-ratio: 1 / 1; }
  .me-actions .text-btn { font-size: 10px; }
}
