/* ==========================================================================
   团队周报 · 样式
   --------------------------------------------------------------------------
   目录
   01  设计令牌（颜色 / 圆角 / 阴影 / 动效）
   02  基础重置与排版
   03  通用组件：按钮、表单、标签、卡片
   04  登录 / 注册页
   05  主框架：侧边栏、顶栏、内容区
   06  统计卡片与提交情况面板
   07  工具栏与周报列表
   08  详情页
   09  编辑器
   10  表格
   11  弹窗与 Toast
   12  辅助样式与动效
   13  打印
   14  响应式
   ========================================================================== */

/* ============================== 01 设计令牌 ============================== */

:root {
  /* —— 品牌色：靛蓝紫 —— */
  --brand-50:  #f1f2fe;
  --brand-100: #e5e7fd;
  --brand-200: #d0d4fb;
  --brand-300: #b0b6f7;
  --brand-400: #8b93f0;
  --brand-500: #5f68e4;
  --brand-600: #4b53cd;
  --brand-700: #3d44a8;
  --brand-800: #333a86;

  /* —— 中性色：带一点蓝调，整体更协调 —— */
  --n-0:   #ffffff;
  --n-25:  #fbfbfe;
  --n-50:  #f6f7fb;
  --n-100: #eef0f7;
  --n-200: #e3e6f0;
  --n-300: #d2d6e3;
  --n-400: #a9b0c4;
  --n-500: #7e8699;
  --n-600: #5a6277;
  --n-700: #414859;
  --n-800: #2b3040;
  --n-900: #1a1e2b;

  /* —— 语义别名（保持与旧版一致的变量名，避免样式断链） —— */
  --bg: var(--n-50);
  --surface: var(--n-0);
  --surface-2: var(--n-25);
  --surface-3: var(--n-100);
  --border: var(--n-200);
  --border-strong: var(--n-300);
  --text: var(--n-900);
  --text-2: var(--n-700);
  --muted: var(--n-500);

  --primary: var(--brand-500);
  --primary-dark: var(--brand-600);
  --primary-soft: var(--brand-50);

  --success: #12a150;
  --success-soft: #e9f8ef;
  --success-border: #bfe8d1;

  --danger: #dc3a30;
  --danger-soft: #fdeeed;
  --danger-border: #f6cfcb;

  --warn: #b7791f;
  --warn-soft: #fdf4e3;
  --warn-border: #f0ddb4;

  /* —— 计划模块专用青色：与周报的靛蓝形成区分 —— */
  --plan-soft: #e6f7f4;
  --plan-border: #b3e5dd;
  --plan-deep: #0d6f63;
  --plan: #12988a;
  --plan-100: #d3f0eb;

  /* —— 形状 —— */
  --radius-xs: 7px;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 18px;
  --sidebar-w: 252px;

  /* —— 阴影：统一用低透明度的冷色，层次更细腻 —— */
  --shadow-xs: 0 1px 2px rgba(20, 26, 48, .045);
  --shadow-sm: 0 1px 3px rgba(20, 26, 48, .06), 0 1px 2px rgba(20, 26, 48, .04);
  --shadow: 0 6px 18px -4px rgba(20, 26, 48, .1), 0 2px 6px rgba(20, 26, 48, .05);
  --shadow-lg: 0 22px 48px -14px rgba(20, 26, 48, .24), 0 4px 12px rgba(20, 26, 48, .07);
  --ring: 0 0 0 3px rgba(95, 104, 228, .16);
  --ring-danger: 0 0 0 3px rgba(220, 58, 48, .16);

  /* —— 动效 —— */
  --ease: cubic-bezier(.22, .9, .28, 1);
  --fast: .15s var(--ease);
  --base: .22s var(--ease);
}

/* ========================= 02 基础重置与排版 ========================= */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.app-root { min-height: 100%; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { -webkit-tap-highlight-color: transparent; }

a { color: var(--brand-600); text-decoration: none; transition: color var(--fast); }
a:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  letter-spacing: -.011em;
  font-weight: 700;
}

::selection { background: var(--brand-200); color: var(--brand-800); }

/* 数字统一等宽，表格与统计数据不会跳动 */
.stat .v, .table td, .nav-count, .list-count, .save-hint { font-variant-numeric: tabular-nums; }

/* 滚动条：细一点，别抢视线 */
* { scrollbar-width: thin; scrollbar-color: var(--n-300) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--n-300);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--n-400); background-clip: content-box; }

/* 键盘聚焦时才显示焦点环，鼠标点击不显示 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ======================== 03 通用组件 ======================== */

/* —— 按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--n-800);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  height: 36px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  transition: background var(--fast), border-color var(--fast),
              box-shadow var(--fast), transform var(--fast), color var(--fast);
  white-space: nowrap;
  user-select: none;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--n-50); border-color: var(--n-400); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn svg { flex: 0 0 auto; }

.btn-primary {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  border-color: var(--brand-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(60, 68, 168, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--brand-600), var(--brand-700));
  border-color: var(--brand-700);
  box-shadow: 0 6px 16px -4px rgba(60, 68, 168, .5);
}
.btn-primary:focus-visible { outline-color: var(--brand-300); }

.btn-danger {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--surface);
}
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger:focus-visible { outline-color: var(--danger); }

.btn-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--n-600);
}
.btn-ghost:hover {
  background: var(--n-100);
  border-color: transparent;
  box-shadow: none;
  color: var(--text);
}

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }

/* —— 表单 —— */
.field { margin-bottom: 15px; }
.field > label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--n-600);
  margin-bottom: 6px;
  letter-spacing: .005em;
}

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 38px;
  outline: none;
  color: var(--text);
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
  box-shadow: var(--shadow-xs);
}
.textarea { padding: 10px 12px; height: auto; resize: vertical; min-height: 90px; line-height: 1.6; }

.input::placeholder, .textarea::placeholder { color: var(--n-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--n-400); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-400);
  box-shadow: var(--ring);
  background: var(--surface);
}

/* 自定义下拉箭头 */
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%237e8699'%20stroke-width='2.6'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M6%209l6%206%206-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

/* 日期/周次选择器的图标颜色统一 */
input[type="week"], input[type="date"] { color-scheme: light; }

/* —— 标签 —— */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
  white-space: nowrap;
  line-height: 1.7;
}
.tag-gray { background: var(--n-100); color: var(--n-600); border-color: var(--n-200); }
.tag-green { background: var(--success-soft); color: #0b7a3c; border-color: var(--success-border); }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
/* 「计划」用青色，和周报的靛蓝在视觉上天然分开 —— 两个模块一眼可辨 */
.tag-plan { background: var(--plan-soft); color: var(--plan-deep); border-color: var(--plan-border); }

/* —— 卡片 —— */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.muted { color: var(--muted); }

/* —— 空状态 —— */
.empty {
  text-align: center;
  padding: 60px 24px 56px;
  color: var(--muted);
  background: var(--surface);
}
.empty::before {
  content: '';
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--n-50)
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%20fill='none'%20stroke='%23a9b0c4'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M15%207h12l7%207v25a2%202%200%200%201-2%202H15a2%202%200%200%201-2-2V9a2%202%200%200%201%202-2z'/%3E%3Cpath%20d='M27%207v7h7'/%3E%3Cpath%20d='M18%2023h12M18%2029h12M18%2035h7'/%3E%3C/svg%3E")
    center / 30px no-repeat;
  border: 1px solid var(--border);
}
.empty h3 { margin: 0 0 8px; color: var(--text); font-size: 15.5px; }
.empty p { margin: 0 0 18px; font-size: 13.5px; }

/* ======================== 04 登录 / 注册页 ======================== */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
  background: var(--n-50);
}
/* 背景光斑 */
.auth-wrap::before,
.auth-wrap::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}
.auth-wrap::before {
  width: 720px; height: 720px;
  top: -320px; left: -220px;
  background: radial-gradient(circle at 50% 50%, rgba(95, 104, 228, .22), transparent 68%);
  animation: float-a 18s var(--ease) infinite alternate;
}
.auth-wrap::after {
  width: 640px; height: 640px;
  bottom: -300px; right: -200px;
  background: radial-gradient(circle at 50% 50%, rgba(18, 161, 80, .16), transparent 68%);
  animation: float-b 22s var(--ease) infinite alternate;
}
@keyframes float-a { to { transform: translate(60px, 40px) scale(1.08); } }
@keyframes float-b { to { transform: translate(-50px, -30px) scale(1.06); } }

.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

/* 表单卡片 */
.auth-card {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px 26px;
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-brand .logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, var(--brand-400), var(--brand-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  box-shadow: 0 6px 16px -6px rgba(60, 68, 168, .55);
}
.auth-brand h1 { font-size: 17px; margin: 0; }
.auth-brand p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }

.auth-tabs {
  display: flex;
  background: var(--n-100);
  border-radius: 11px;
  padding: 3px;
  margin-bottom: 22px;
  gap: 3px;
}
.auth-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--n-600);
  transition: background var(--fast), color var(--fast), box-shadow var(--fast);
}
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button.active {
  background: var(--surface);
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}

.form-error {
  background: var(--danger-soft);
  color: #a92c23;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 34px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  position: relative;
}
.form-error::before {
  content: '!';
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 15px; text-align: center;
}
.form-error.show { display: block; animation: shake .3s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.demo-box {
  margin-top: 22px;
  border-top: 1px dashed var(--border-strong);
  padding-top: 15px;
  font-size: 12.5px;
  color: var(--n-600);
}
.demo-box summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--n-600);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.demo-box summary::-webkit-details-marker { display: none; }
.demo-box summary::before {
  content: '';
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform var(--fast);
}
.demo-box[open] summary::before { transform: rotate(90deg) translateX(1px); }

.demo-table { width: 100%; margin-top: 12px; border-collapse: collapse; }
.demo-table td, .demo-table th {
  border-bottom: 1px solid var(--border);
  padding: 6px 4px;
  text-align: left;
  font-size: 12.5px;
}
.demo-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.demo-table code {
  background: var(--n-100);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ======================== 05 主框架 ======================== */

.shell { display: flex; min-height: 100vh; }

/* —— 侧边栏 —— */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 16px;
}
.sidebar-brand .logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(140deg, var(--brand-400), var(--brand-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; flex: 0 0 auto;
  box-shadow: 0 6px 16px -6px rgba(60, 68, 168, .55);
}
.sidebar-brand strong { font-size: 14.5px; display: block; line-height: 1.25; letter-spacing: -.01em; }
.sidebar-brand span { font-size: 11.5px; color: var(--muted); }

.nav { padding: 6px 12px 12px; flex: 1; overflow-y: auto; }
.nav-group-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--n-400);
  text-transform: uppercase;
  padding: 14px 10px 8px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  margin-bottom: 2px;
  border-radius: 10px;
  color: var(--n-600);
  cursor: pointer;
  font-weight: 500;
  font-size: 13.5px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--fast), color var(--fast);
}
.nav-item::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  width: 3px; height: 18px;
  margin-top: -9px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-500);
  opacity: 0;
  transform: scaleY(.3);
  transition: opacity var(--base), transform var(--base);
}
.nav-item:hover { background: var(--n-100); color: var(--text); }
.nav-item.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.nav-item.active::before { opacity: 1; transform: none; }
.nav-item svg { flex: 0 0 auto; opacity: .8; transition: opacity var(--fast); }
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--n-500);
  background: var(--n-100);
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 700;
  transition: background var(--fast), color var(--fast);
}
.nav-item.active .nav-count { background: var(--brand-100); color: var(--brand-700); }

.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--n-25);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex: 0 0 auto; font-size: 13.5px;
  box-shadow: 0 0 0 2px var(--surface), 0 2px 6px rgba(20, 26, 48, .14);
  letter-spacing: .02em;
}
.avatar.gray { background: linear-gradient(135deg, var(--n-300), var(--n-400)); }
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user .who strong {
  display: block; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .who span { font-size: 11.5px; color: var(--muted); }

/* —— 主区域 —— */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 30px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap;
}
.topbar h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.topbar .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.topbar .tag { padding: 3px 11px; }
/* 顶栏的届别标签带一个呼吸圆点，强化“当前可见范围”的提示 */
.topbar .tag::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(95, 104, 228, .16);
}

.content { padding: 26px 30px 72px; max-width: 1200px; width: 100%; }

/* —— 提示横幅 —— */
.banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  color: #7a5a12;
  border-radius: var(--radius);
  padding: 11px 15px;
  font-size: 13px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}
.banner .spacer { flex: 1; }
.banner.info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }

/* =================== 06 统计卡片与提交情况 =================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--base), transform var(--base), border-color var(--base);
}
.stat::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  opacity: 0;
  transition: opacity var(--base);
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--brand-200); }
.stat:hover::after { opacity: 1; }
.stat .k { font-size: 12.5px; color: var(--n-500); font-weight: 600; }
.stat .v {
  font-size: 27px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--text);
}
.stat .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat .stat-icon {
  position: absolute;
  right: 15px; top: 15px;
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50);
  color: var(--brand-600);
}
.stat .stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat .stat-icon.warm { background: var(--warn-soft); color: var(--warn); }

/* —— 提交情况面板 —— */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
}
.panel-head { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 13px; }
.panel-head strong { font-size: 14px; letter-spacing: -.01em; }
.panel-head .spacer { flex: 1; }
.panel-head .panel-icon {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--brand-50); color: var(--brand-600);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.panel-foot { font-size: 12.5px; margin-top: 12px; }

.progress {
  height: 7px;
  border-radius: 999px;
  background: var(--n-100);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 2px rgba(20, 26, 48, .05);
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  transition: width .5s var(--ease);
  position: relative;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.member-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px;
  padding: 3px 11px 3px 4px;
  font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--n-600);
  transition: background var(--fast), border-color var(--fast);
}
.member-chip .avatar-xs { width: 19px; height: 19px; font-size: 10px; }
.member-chip.done { background: var(--success-soft); border-color: var(--success-border); color: #0b7a3c; }
.member-chip.done svg { color: var(--success); }
.member-chip.pending { background: var(--danger-soft); border-color: var(--danger-border); color: #a92c23; }
.member-chip.pending:hover { border-color: var(--danger); }

/* ======================= 07 工具栏与列表 ======================= */

.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.toolbar .search .input { padding-left: 34px; }
.toolbar .search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--n-400);
  pointer-events: none;
  transition: color var(--fast);
}
.toolbar .search:focus-within svg { color: var(--brand-500); }
.toolbar .select { width: auto; min-width: 138px; }

.list-count {
  font-size: 12.5px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-count::before {
  content: '';
  width: 3px; height: 12px; border-radius: 2px;
  background: var(--n-300);
}

.report-list { display: flex; flex-direction: column; gap: 12px; }

.report-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--base), box-shadow var(--base), transform var(--base);
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  overflow: hidden;
}
.report-card::before {
  content: '';
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  opacity: 0;
  transform: scaleY(.35);
  transform-origin: center;
  transition: opacity var(--base), transform var(--base);
}
.report-card:hover {
  border-color: var(--brand-200);
  box-shadow: 0 10px 28px -8px rgba(60, 68, 168, .22), 0 2px 6px rgba(20, 26, 48, .05);
  transform: translateY(-2px);
}
.report-card:hover::before { opacity: 1; transform: none; }
.report-card:active { transform: translateY(0); }

.report-card h3 {
  margin: 0 0 7px;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.45;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  letter-spacing: -.012em;
}
.report-card .excerpt {
  color: var(--n-600);
  font-size: 13.5px;
  margin: 0 0 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.report-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}
.report-meta .author { display: flex; align-items: center; gap: 7px; color: var(--n-700); font-weight: 600; }
.avatar-xs {
  width: 20px; height: 20px; border-radius: 50%; font-size: 10.5px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; flex: 0 0 auto;
  letter-spacing: .02em;
}

/* ========================== 08 详情页 ========================== */

.detail-head { margin-bottom: 20px; }
.detail-head h1 {
  font-size: 25px;
  margin: 0 0 14px;
  line-height: 1.38;
  letter-spacing: -.022em;
}
.detail-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.rich-content {
  font-size: 14.8px;
  line-height: 1.86;
  color: var(--n-800);
  word-wrap: break-word;
  max-width: 74ch;
}
.rich-content p { margin: 0 0 15px; }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4 {
  margin: 26px 0 11px;
  line-height: 1.4;
  letter-spacing: -.016em;
}
.rich-content h1 { font-size: 22px; }
.rich-content h2 { font-size: 19px; }
.rich-content h3 { font-size: 16.5px; }
.rich-content > :first-child { margin-top: 0; }
.rich-content ul, .rich-content ol { margin: 0 0 15px; padding-left: 26px; }
.rich-content li { margin-bottom: 6px; }
.rich-content li::marker { color: var(--brand-400); }
.rich-content blockquote {
  margin: 0 0 15px;
  padding: 10px 16px;
  border-left: 3px solid var(--brand-300);
  background: var(--n-50);
  color: var(--n-600);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rich-content pre {
  background: var(--n-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.rich-content code {
  background: var(--n-100);
  padding: 1.5px 5px;
  border-radius: 5px;
  font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.rich-content pre code { background: none; padding: 0; }
.rich-content table { border-collapse: collapse; margin-bottom: 15px; width: 100%; font-size: 13.5px; }
.rich-content th, .rich-content td { border: 1px solid var(--border); padding: 8px 11px; text-align: left; }
.rich-content th { background: var(--n-50); font-weight: 600; }
.rich-content a { text-decoration: underline; text-underline-offset: 3px; }
.rich-content hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

.detail-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.detail-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.detail-nav-item {
  position: relative;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--base), box-shadow var(--base), transform var(--base);
  min-width: 0;
}
.detail-nav-item:hover {
  border-color: var(--brand-200);
  box-shadow: 0 8px 22px -8px rgba(60, 68, 168, .22);
  transform: translateY(-1px);
}
.detail-nav-item.right { text-align: right; }
.detail-nav-item .dir { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.detail-nav-item strong {
  display: block; font-size: 13.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ========================== 09 编辑器 ========================== */

.editor-toolbar {
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 7px 9px;
  background: var(--n-25);
}
.editor-toolbar .tb {
  border: none;
  background: transparent;
  border-radius: 7px;
  min-width: 32px;
  height: 30px;
  padding: 0 9px;
  cursor: pointer;
  color: var(--n-600);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--fast), color var(--fast);
}
.editor-toolbar .tb:hover { background: var(--n-200); color: var(--text); }
.editor-toolbar .tb.active { background: var(--brand-100); color: var(--brand-700); }
.editor-toolbar .sep { width: 1px; height: 18px; background: var(--n-300); margin: 0 5px; }

.editor-surface {
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-height: 340px;
  padding: 18px 20px;
  outline: none;
  background: var(--surface);
  font-size: 14.8px;
  line-height: 1.82;
  overflow-y: auto;
  max-height: 60vh;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.editor-surface:focus { border-color: var(--brand-400); box-shadow: var(--ring); }
.editor-surface:empty::before {
  content: attr(data-placeholder);
  color: var(--n-400);
  pointer-events: none;
}
.editor-surface p { margin: 0 0 13px; }
.editor-surface ul, .editor-surface ol { padding-left: 26px; }
.editor-surface blockquote {
  margin: 0 0 13px;
  padding-left: 14px;
  border-left: 3px solid var(--brand-300);
  color: var(--n-600);
}

.editor-actions {
  display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap;
}
.editor-actions .spacer { flex: 1; }
.save-hint {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--n-50);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}
.save-hint:empty { display: none; }

/* ================= 09b Markdown 模式与周报插图 ================= */

/* hidden 属性必须压住元素自身的 display，否则「藏起来」的那块还会露出来 */
.editor-surface[hidden], .editor-md[hidden], .md-preview[hidden], .mode-btn[hidden] {
  display: none !important;
}

.editor-modes {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.editor-modes .spacer { flex: 1; }

/* 富文本 / Markdown 切换 */
.mode-switch {
  display: inline-flex; gap: 3px;
  background: var(--n-100);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.mode-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--n-600);
  border-radius: 999px;
  padding: 5px 13px;
  transition: background var(--fast), color var(--fast);
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-xs); }
.mode-btn.ghost { border: 1px solid var(--border); background: var(--surface); padding: 5px 12px; }
.mode-btn svg { opacity: .85; }
.mode-hint { font-size: 12px; color: var(--muted); }

/* Markdown 源码输入区：等宽字体、行距放宽，读起来更像代码 */
.editor-md {
  display: block;
  width: 100%;
  min-height: 340px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.78;
  tab-size: 2;
}
.editor-md::placeholder { color: var(--n-400); }

/* 预览面板：一眼看出保存后长什么样 */
.md-preview {
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px dashed var(--brand-200);
  border-radius: var(--radius-sm);
  background: var(--brand-50);
}

/* 正文插图：不撑破版面，也不比正文宽 */
.rich-content img, .md-preview img, .editor-surface img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--n-25);
}
.rich-content figure { margin: 14px 0; }
.rich-content figcaption {
  font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px;
}

/* 往编辑区拖图片时给个落点提示 */
.editor-surface.drop-active {
  border-color: var(--brand-400);
  box-shadow: var(--ring);
  background: var(--brand-50);
}

/* 教师角色标签 */
.tag-teacher { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }

/* ============= 09c 每周计划模块 ============= */

/* 写周报时才会出现的「引用我的本周计划」工具条 */
.quote-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--plan-soft);
  border: 1px dashed var(--plan-border);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--plan-deep);
  margin-bottom: 11px;
}
.quote-bar .muted { font-weight: 400; }
.quote-bar .btn { border-color: var(--plan-border); background: var(--surface); color: var(--plan-deep); }
.quote-bar .btn:hover { background: var(--plan-100); border-color: var(--plan); color: var(--plan-deep); }

/* 计划编辑器里给一个淡淡的青色描边，暗示"这是计划，不是周报" */
.editor-card-plan .editor-surface:focus,
.editor-card-plan .editor-md:focus {
  border-color: var(--plan);
  box-shadow: 0 0 0 3px rgba(18, 152, 138, .16);
}

/* 侧边栏分组标题：三个分组（周报 / 每周计划 / 团队）的视觉分隔 */
.nav-group-title + .nav-item { margin-top: 2px; }
.nav-item + .nav-group-title { margin-top: 14px; }

/* =========================== 10 表格 =========================== */

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th {
  font-size: 11px;
  color: var(--n-500);
  font-weight: 700;
  background: var(--n-25);
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--n-25); }
.table tbody tr:last-child td { border-bottom: none; }
.table .row-actions { display: flex; gap: 7px; justify-content: flex-end; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ======================= 11 弹窗与 Toast ======================= */

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(20, 26, 48, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
  animation: fade .16s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 452px;
  max-height: 88vh;
  overflow-y: auto;
  animation: pop .2s var(--ease);
}
@keyframes pop {
  from { transform: scale(.96) translateY(6px); opacity: 0 }
  to { transform: none; opacity: 1 }
}
.modal-head {
  position: relative;
  padding: 20px 52px 4px 22px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.015em;
}
.modal-close {
  position: absolute;
  right: 14px; top: 15px;
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  border-radius: 9px;
  color: var(--n-400);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--fast), color var(--fast);
}
.modal-close:hover { background: var(--n-100); color: var(--n-700); }
.modal-body { padding: 14px 22px 6px; }
.modal-body > p:first-child { margin-top: 0; }
.modal-foot {
  padding: 18px 22px 20px;
  display: flex; gap: 10px; justify-content: flex-end;
}

.toast-root {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--n-800);
  color: #fff;
  border-radius: 11px;
  padding: 11px 16px 11px 13px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: slidein .24s var(--ease);
}
.toast::before {
  content: '';
  flex: 0 0 auto;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18)
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffff'%20stroke-width='3.4'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%206L9%2017l-5-5'/%3E%3C/svg%3E")
    center / 10px no-repeat;
}
.toast.error { background: #b32d24; }
.toast.error::before {
  background: rgba(255, 255, 255, .18)
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23ffffff'%20stroke-width='3.4'%20stroke-linecap='round'%3E%3Cpath%20d='M12%207v6M12%2017h.01'/%3E%3C/svg%3E")
    center / 10px no-repeat;
}
.toast.success { background: #0d7a3e; }
@keyframes slidein {
  from { transform: translateY(10px) scale(.97); opacity: 0 }
  to { transform: none; opacity: 1 }
}

/* ==================== 12 辅助样式与动效 ==================== */

.section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 28px 0 14px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.012em;
}
.section-title:first-child { margin-top: 0; }
.section-title .spacer { flex: 1; }
.section-title .hint { font-weight: 500; font-size: 12.5px; color: var(--muted); }

.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user strong { font-weight: 600; }

.rule-list { margin: 0; padding-left: 20px; color: var(--n-600); line-height: 2; }
.rule-list strong { color: var(--text); }
.rule-list li::marker { color: var(--brand-400); }

.maintain-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.draft-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand-700);
  margin-bottom: 11px;
}
.draft-bar .spacer { flex: 1; }
.draft-bar[hidden] { display: none; }

/* 页面切换：内容区子元素依次淡入，避免生硬跳变
   用 backwards 而非 both —— 动画结束后不残留 transform，避免盖掉 hover 位移 */
.content > * { animation: rise .34s var(--ease) backwards; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .07s; }
.content > *:nth-child(4) { animation-delay: .1s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================ 13 打印 ============================ */

@media print {
  .sidebar, .topbar, .no-print, .toast-root, .modal-mask, .detail-nav { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .content > * { animation: none; }
  body { background: #fff; font-size: 12pt; }
  .card, .printable {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: none !important;
  }
  .detail-meta { border-bottom: 1px solid #ddd; }
  .rich-content { max-width: none; font-size: 11.5pt; }
  .rich-content a { color: inherit; text-decoration: underline; }
  .progress { border: 1px solid #ddd; }
  .empty::before { display: none; }
}

/* =========================== 14 响应式 =========================== */

@media (max-width: 1080px) {
  :root { --sidebar-w: 224px; }
  .content { padding: 22px 20px 64px; }
  .topbar { padding: 14px 20px; }
}

/* 主框架：窄屏改为顶部导航 */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto;
    position: sticky; top: 0; z-index: 30;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(20, 26, 48, .05);
  }
  .sidebar-brand { padding: 12px 14px 8px; }
  .sidebar-brand .logo { width: 30px; height: 30px; border-radius: 9px; font-size: 14px; }
  .sidebar-brand strong { font-size: 14px; }
  .nav {
    display: flex; gap: 5px; overflow-x: auto;
    padding: 4px 12px 12px; flex: none;
  }
  .nav-group-title { display: none; }
  .nav-item {
    width: auto; white-space: nowrap;
    padding: 8px 12px; margin-bottom: 0;
    background: var(--n-50);
    border: 1px solid var(--border);
    font-size: 13px;
  }
  .nav-item::before { display: none; }
  .nav-item.active { background: var(--brand-50); border-color: var(--brand-200); }
  .nav-item .nav-count { margin-left: 2px; }
  .sidebar-user { display: none; }

  .topbar { padding: 13px 16px; position: static; }
  .content { padding: 18px 16px 64px; }
  .detail-nav { grid-template-columns: 1fr; }
  .detail-head h1 { font-size: 21px; }
  .report-card { padding: 15px 16px; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat .v { font-size: 22px; }
  .stat .stat-icon { display: none; }
  .toolbar .search { max-width: none; flex: 1 1 100%; }
  .toolbar .select { flex: 1 1 auto; min-width: 0; }
  .toolbar .spacer { display: none; }
  .toolbar .btn-primary { flex: 1 1 100%; }
  .editor-actions .btn { flex: 1 1 auto; }
  .editor-actions .spacer { flex-basis: 100%; }
  .save-hint { margin-left: auto; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .detail-meta { gap: 10px; }
  .table th, .table td { padding: 10px; }
  .toast-root { left: 16px; right: 16px; align-items: stretch; }
  .toast { max-width: none; }
}

/* ==========================================================================
   意见与讨论（周报详情页）
   ========================================================================== */

.comment-section {
  margin-top: 18px;
  padding: 20px 22px;
}

.comment-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.comment-title strong {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.comment-count {
  font-size: 12.5px;
  color: var(--muted);
}

.comment-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* 乐观更新期间的占位评论 */
.comment-item.is-pending {
  opacity: .55;
}

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.comment-author {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.comment-time {
  font-size: 12px;
  color: var(--muted);
}

.comment-del {
  margin-left: auto;
  background: none;
  border: none;
  padding: 3px 7px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: color .15s, background .15s;
}

.comment-del:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* 评论是纯文本，靠 pre-wrap 保留用户写的换行 */
.comment-text {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-empty {
  margin: 0 0 16px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 78px;
  resize: vertical;
  padding: 11px 13px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.comment-input:focus {
  background: var(--surface);
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.comment-input::placeholder {
  color: var(--muted);
}

.comment-form-foot {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comment-hint {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .comment-form-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .comment-form-foot .btn {
    width: 100%;
  }
  .comment-section {
    padding: 16px 14px;
  }
}

/* 打印周报时不该带上讨论区 */
@media print {
  .comment-section {
    display: none !important;
  }
}
