﻿/* ==========================================================================
   乐阅书屋 · 订单台账（多用户版）
   ========================================================================== */

:root {
  --paper: #f4f1e9;
  --surface: #ffffff;
  --surface-2: #fbf9f4;
  --surface-3: #f7f4ec;

  --ink: #1d2724;
  --ink-2: #3d4a45;
  --muted: #78857e;
  --muted-2: #97a29b;

  --line: #e4e0d4;
  --line-2: #efebe1;
  --line-3: #f4f1e9;

  --primary: #145c4c;
  --primary-2: #0e463a;
  --primary-3: #17705b;
  --primary-soft: #e7f1ee;
  --primary-soft-2: #d9ebe5;

  --amber: #b3773a;
  --amber-soft: #f9eeda;
  --red: #ad3f2f;
  --red-soft: #fbeae6;
  --blue: #2c6690;
  --blue-soft: #e9f1f8;

  --radius: 16px;
  --topbar-h: 57px;
  --shadow-sm: 0 1px 2px rgba(29, 39, 36, .05);
  --shadow: 0 1px 2px rgba(29, 39, 36, .04), 0 12px 28px -18px rgba(29, 39, 36, .35);
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 500px at 85% -10%, var(--primary-glow), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(179, 119, 58, .06), transparent 55%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--primary-3); outline-offset: 2px; }

/* ------------------------------------------------------------- 登录注册 ---- */
.auth {
  /* 留出底部备案页脚的位置，避免把页脚顶到屏幕外 */
  min-height: calc(100vh - 62px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(410px, 100%);
  padding: 26px 26px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 60px -40px rgba(29, 39, 36, .5);
}

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand h1 { font-size: 20px; font-weight: 680; letter-spacing: .06em; }
.auth-brand p { font-size: 11.5px; color: var(--muted); letter-spacing: .16em; }

.auth-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--surface-3); border-radius: 11px; }
.auth-tab { flex: 1; height: 32px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; color: var(--muted); }
.auth-tab.is-on { background: #fff; color: var(--ink); font-weight: 620; box-shadow: var(--shadow-sm); }

.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.auth-form input {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  background: #fff;
}
.auth-form input:focus { outline: none; border-color: var(--primary-3); box-shadow: 0 0 0 3px var(--primary-ring); }
.auth-error { min-height: 16px; margin: 0; font-size: 12.5px; color: var(--red); }
.auth-note { margin-top: 14px; font-size: 11.5px; color: var(--muted-2); line-height: 1.7; }
.auth-note code { padding: 1px 4px; border-radius: 4px; background: var(--surface-3); font-family: var(--mono); font-size: 11px; }

/* ---------------------------------------------------------------- 顶栏 ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: none;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, var(--primary-3), var(--primary-2));
  box-shadow: 0 6px 14px -8px var(--primary-shadow), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.brand-mark svg { width: 20px; height: 20px; }
.brand-text h1 { font-size: 17px; font-weight: 680; letter-spacing: .05em; line-height: 1.25; }
.brand-text p { font-size: 11px; color: var(--muted); letter-spacing: .14em; }

.tabs { display: flex; gap: 2px; align-items: center; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }

.tab {
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover { background: var(--surface-3); }
.tab.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 620; }

.tab-dot {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.user-box { display: flex; align-items: center; gap: 10px; flex: none; }
.user-chip { display: flex; flex-direction: column; line-height: 1.3; text-align: right; }
.user-chip b { font-size: 13px; font-weight: 620; }
.user-chip em { font-size: 11px; font-style: normal; color: var(--muted); }

/* ---------------------------------------------------------------- 通用 ---- */
.page { max-width: none; margin: 0 auto; padding: 18px 22px 40px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13.5px;
  font-weight: 560;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(180deg, var(--primary-3), var(--primary));
  box-shadow: 0 1px 2px var(--primary-shadow), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn.primary:hover { background: linear-gradient(180deg, var(--primary-3), var(--primary-2)); }

.btn.ghost {
  color: var(--ink-2);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover { background: var(--surface-3); border-color: #d6d0c0; }

.btn.danger { color: #fff; background: linear-gradient(180deg, #c04a37, #a83a2b); }
.btn.danger-ghost { color: var(--red); border-color: #f0d8d2; background: #fff; }
.btn.danger-ghost:hover { background: var(--red-soft); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; height: 40px; }

.link-btn {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 12.5px;
  color: var(--primary);
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--primary-link);
}
.link-btn:hover { color: var(--primary-2); text-decoration-color: currentColor; }
.link-btn.danger { color: var(--red); text-decoration-color: rgba(173, 63, 47, .35); }

.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.is-del:hover { background: var(--red-soft); color: var(--red); }

/* -------------------------------------------------------------- 概览卡 ---- */
.overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat {
  position: relative;
  overflow: hidden;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 11.5px; letter-spacing: .08em; color: var(--muted); }
.stat-value { margin-top: 3px; font-size: 24px; font-weight: 660; line-height: 1.2; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.stat-value .unit { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stat.is-hl { border-color: transparent; background: linear-gradient(140deg, var(--primary-3) 0%, var(--primary-2) 100%); box-shadow: 0 10px 26px -16px var(--primary-shadow); }
.stat.is-hl .stat-label { color: var(--primary-on-soft); }
.stat.is-hl .stat-value { color: #fff; }
.stat.is-hl .stat-value .unit { color: var(--primary-on-soft); }
.stat.is-hl .stat-sub { color: var(--primary-on-soft-2); }
.stat.is-hl::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -46px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 68%);
}
.stat.is-warn .stat-value { color: var(--amber); }
.stat.is-loss .stat-value { color: var(--red); }
.stat.is-loss { border-color: #f0d6d1; background: #fffdfc; }

/* 列设置浮层 */
.colpop {
  position: fixed;
  z-index: 55;
  width: 220px;
  max-height: 330px;
  overflow: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(29, 39, 36, .5);
  font-size: 13px;
}
.colpop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--muted);
}
.colpop-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; cursor: pointer; }
.colpop-item:hover { background: var(--surface-3); }

/* ---------------------------------------------------------------- 面板 ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head { padding: 12px 16px; border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, #fff, #fdfcf8); }
.panel-head h3 { font-size: 13.5px; font-weight: 640; }
.panel-title { font-size: 14.5px; font-weight: 660; }
.hint-inline { font-size: 12px; color: var(--muted-2); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fff, #fdfcf8);
}
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1 1 auto; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; }
.toolbar-right .admin-only { display: flex; gap: 8px; align-items: center; }

/* 批量操作条 */
.bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  background: var(--primary-soft);
  border-bottom: 1px solid var(--primary-soft-2);
  font-size: 12.5px;
  color: var(--primary-2);
}
.bulk-sep { color: var(--muted); }

/* 搜索与筛选 */
.search { position: relative; display: block; flex: 1 1 520px; min-width: 220px; max-width: 760px; }
.search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.search input {
  width: 100%;
  height: 36px;
  padding: 0 40px 0 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13.5px;
}
.search input:focus { outline: none; background: #fff; border-color: var(--primary-3); box-shadow: 0 0 0 3px var(--primary-ring); }
.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  pointer-events: none;
}

.selects { display: flex; gap: 8px; flex-wrap: wrap; }

select, .input-mini, .input-date {
  appearance: none;
  -webkit-appearance: none;
  height: 36px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378857e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
  font-size: 13px;
  color: var(--ink-2);
}
select:hover, .input-mini:hover, .input-date:hover { border-color: #d6d0c0; }
select:focus, .input-mini:focus, .input-date:focus { outline: none; border-color: var(--primary-3); box-shadow: 0 0 0 3px var(--primary-ring); }

.input-mini { padding-right: 10px; height: 32px; font-size: 12.5px; background-image: none; }
/* 输入框不该带下拉箭头（原来沿用 select 样式） */
input.input-mini, input.input-date { background-image: none; }
.input-date { padding-right: 10px; background-image: none; height: 34px; }

/* --------------------------------------------------------------- 表格 ---- */
.table-wrap {
  /* 不再限制高度：表格随行数往下排，整页滚动；纵向不产生内部滚动条，表头才能吸在窗口顶部 */
  overflow-x: auto;
  overflow-y: clip;
  max-height: none;
  scrollbar-width: thin;
  scrollbar-color: #cfcabd transparent;
}
.table-wrap.short { max-height: 320px; overflow-y: auto; }

/* 常驻横向滚动条（表格很宽，滚到后面也能拖动） */
.hscroll {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  z-index: 35;
  display: none;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(255, 255, 255, .95);
  border-top: 1px solid var(--line);
}
.hscroll.is-on { display: block; }
.hscroll-inner { height: 1px; }
.table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-thumb { background: #d3cec0; border-radius: 8px; border: 2px solid #fff; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: #bfb9a8; }

table { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13.5px; }

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 40px;
  padding: 0 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
  background: #faf8f2;
  border-bottom: 1px solid var(--line);
}
thead th[data-key] { cursor: pointer; user-select: none; }
thead th[data-key]:hover { background: #f4f1e7; color: var(--ink-2); }
thead th.is-sorted { color: var(--primary); background: #f0f6f3; }

.th-inner { display: flex; align-items: center; gap: 4px; }
.ta-r .th-inner, th.ta-r .th-inner { justify-content: flex-end; }
.sort-ind { font-size: 8px; line-height: 1; opacity: 0; transition: opacity .14s ease; color: var(--primary); }
thead th[data-key]:hover .sort-ind { opacity: .3; }
thead th.is-sorted .sort-ind { opacity: 1; }

tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #faf8f1; }
tbody tr.is-selected td { background: #f0f6f3; }
tbody tr.is-selected:hover td { background: #e9f2ed; }

.col-select { position: sticky; left: 0; z-index: 1; width: 46px; padding-left: 14px !important; padding-right: 4px !important; background: var(--surface); }
.col-sticky { position: sticky; left: 46px; z-index: 1; background: var(--surface); box-shadow: 6px 0 8px -8px rgba(29, 39, 36, .35); }
.col-actions { position: sticky; right: 0; z-index: 1; background: var(--surface); border-left: 1px solid var(--line-2); }
thead .col-select, thead .col-sticky, thead .col-actions { z-index: 4; background: #faf8f2; }
tbody tr:hover .col-select, tbody tr:hover .col-sticky, tbody tr:hover .col-actions { background: #faf8f1; }
tbody tr.is-selected .col-select, tbody tr.is-selected .col-sticky, tbody tr.is-selected .col-actions { background: #f0f6f3; }
.table-wrap.is-scrolled .col-sticky { box-shadow: 10px 0 12px -10px rgba(29, 39, 36, .55); }

input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }

/* 斑马纹（需求 8：白 / 浅灰隔行） */
tbody tr:nth-child(even) td { background: #faf8f2; }
tbody tr:nth-child(even) td.col-select,
tbody tr:nth-child(even) td.col-sticky,
tbody tr:nth-child(even) td.col-actions { background: #faf8f2; }
tbody tr:hover td,
tbody tr:hover td.col-select,
tbody tr:hover td.col-sticky,
tbody tr:hover td.col-actions { background: #f1f6f4; }
tbody tr.is-selected td,
tbody tr.is-selected td.col-select,
tbody tr.is-selected td.col-sticky,
tbody tr.is-selected td.col-actions { background: #e8f3ee; }

/* 订单状态浓色块（需求 10） */
.badge-solid {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-solid::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
}

/* 颜色标注（需求 9） */
td.cell-markable { cursor: pointer; }
td.cell-markable:hover { box-shadow: inset 0 0 0 1px var(--primary-soft-2); }
.mark-cell { padding: 1px 5px; border-radius: 4px; }

/* 书名单元格：标题可省略，右侧「备注」提醒固定不被裁掉 */
.cell-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.cell-title-wrap .cell-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.title-note-dot {
  flex: none;
  margin-left: 0;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  color: #7a5a12;
  background: #fbe6a6;
  border: 1px solid #eccf74;
  white-space: nowrap;
}
.title-note-dot::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: #c99612;
  vertical-align: 1px;
}

/* 相邻重复的订单编号：黄色底，方便一眼看出同单多件 */
.cell-mono.is-adjacent-dup {
  background: #fde68a;
  box-shadow: inset 0 0 0 1px #f2cf55;
  color: #6b4b00;
  font-weight: 600;
}

.colorpop {
  position: fixed;
  z-index: 56;
  width: 252px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(29, 39, 36, .5);
  font-size: 12.5px;
}
.colorpop-head { margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.colorpop-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.colorpop-label { width: 76px; white-space: nowrap; color: var(--ink-2); }
.colorpop-sws { display: flex; gap: 5px; }
.colorpop .sw {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted-2);
  padding: 0;
}
.colorpop .sw.is-on { outline: 2px solid var(--primary); outline-offset: 1px; }

/* 多条件搜索（常驻显示，输入框短一些，右侧跟搜索按钮） */
.adv-search {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  background: #fdfcf9;
}
.adv-search label {
  flex: 0 1 150px;
  min-width: 116px;
  display: grid;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.adv-search input {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  background: #fff;
}
.adv-search input:focus { outline: none; border-color: var(--primary-3); box-shadow: 0 0 0 3px var(--primary-ring); }
.adv-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* 通知铃（需求 11） */
.bell {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
}
.bell:hover { background: var(--surface-3); }
.bell svg { width: 17px; height: 17px; }
.bell.has-alert { border-color: #f0c9c0; background: #fdf1ee; color: var(--red); }
.bell-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.notif-panel {
  position: fixed;
  z-index: 56;
  width: 340px;
  max-height: 420px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(29, 39, 36, .5);
  font-size: 13px;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
  background: #fdfcf9;
  position: sticky;
  top: 0;
}
.notif-item { padding: 9px 14px; border-bottom: 1px solid var(--line-3); display: flex; flex-direction: column; gap: 3px; }
.notif-item:last-child { border-bottom: 0; }
.notif-item b { font-family: var(--mono); font-size: 12.5px; }
.notif-item span { font-size: 12px; color: var(--muted); }
.notif-empty { padding: 22px 14px; text-align: center; color: var(--muted-2); font-size: 12.5px; }

/* 走势图密集模式 */
.bars.is-dense { gap: 3px; }
.bars.is-dense .bar-lab { font-size: 10px; white-space: nowrap; overflow: visible; }
.bars.is-dense .bar-val { font-size: 10px; }

/* 可就地编辑的单元格 */
td.is-editable { cursor: pointer; }
td.is-editable:hover { background: #f1f9f6; box-shadow: inset 0 0 0 1px var(--primary-soft-2); }
.cell-edit {
  width: 100%;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--primary-3);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 0 0 3px var(--primary-ring-2);
}
.cell-edit:focus { outline: none; }
.mcard { cursor: pointer; }

.ta-r { text-align: right; }
.ta-c { text-align: center; }

/* 生效中的筛选小标签（如从看板跳过来时的「日期」） */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 4px 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #cde7dd;
}
.filter-chip b { font-weight: 640; }
.filter-chip button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.filter-chip button:hover { background: rgba(0, 0, 0, .08); }

/* 可点击的统计卡（如「亏损单量」） */
.stat.is-clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.stat.is-clickable:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -18px rgba(29, 39, 36, .6); }
.stat.is-clickable:focus-visible { outline: 2px solid var(--primary-3); outline-offset: 2px; }

/* 筛选按钮激活态（如「只看亏损」） */
.btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 个人中心业绩看板：8 张卡按 4 列排 */
#myStats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { #myStats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { #myStats { grid-template-columns: 1fr; } }

/* 颜色标注按钮（书名后面那一列）：做大一点，方便点 */
.btn-color {
  width: 34px;
  height: 32px;
  border-radius: 9px;
  color: #9aa39d;
}
.btn-color svg { width: 20px; height: 20px; }
.btn-color:hover { background: var(--surface-3); color: var(--ink-2); }
.btn-color.is-set { background: #f5f3ea; }
.btn-color.is-set svg { stroke-width: 2.2; }
.cell-mono { font-family: var(--mono); font-size: 12.5px; color: #40504a; user-select: text; }
.cell-title { font-weight: 560; color: var(--ink); }
.cell-num, .cell-money { font-variant-numeric: tabular-nums; }
.cell-money { color: var(--ink-2); }
.cell-fee { font-variant-numeric: tabular-nums; color: var(--muted); }
.cell-muted { color: var(--muted-2); }
.cell-profit { font-variant-numeric: tabular-nums; font-weight: 620; }
.cell-profit.pos, .cell-rate.pos { color: #12725a; }
.cell-profit.neg, .cell-rate.neg { color: var(--red); }
.cell-profit.zero, .cell-rate.zero { color: var(--muted-2); }
.cell-rate { font-variant-numeric: tabular-nums; font-weight: 560; }
.cell-address { color: var(--ink-2); font-size: 12.5px; }
.cell-buyer { display: inline-flex; align-items: center; gap: 6px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.t-ok { color: #16694f; background: #e6f3ed; }
.badge.t-info { color: #2a628c; background: #e9f1f8; }
.badge.t-idle { color: #7a6a50; background: #f6f0e3; }
.badge.t-bad { color: #a23b2c; background: #fbeae6; }
.badge.t-plain { color: #5d6a64; background: #f1f2f0; }

.changed-mark {
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: #99551a;
  background: #fbf0dd;
  border: 1px solid #f0dcbb;
  cursor: help;
}

/* 空态 */
.empty { padding: 54px 20px 58px; text-align: center; color: var(--muted); }
.empty-title { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.empty-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted-2); }
.empty .btn { margin-top: 14px; }

/* 页脚 */
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line-2);
  background: #fdfcf8;
  font-size: 12.5px;
  color: var(--muted);
}
.foot-left, .foot-right { display: flex; align-items: center; gap: 10px; }
.dot { color: var(--muted-2); }
.page-size { display: flex; align-items: center; gap: 6px; }
.page-size select { height: 30px; padding: 0 26px 0 8px; font-size: 12.5px; border-radius: 8px; }

.pager { display: flex; align-items: center; gap: 4px; }
.pg {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pg:hover:not(:disabled):not(.is-active) { background: var(--surface-3); border-color: #d6d0c0; }
.pg.is-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pg:disabled { opacity: .4; cursor: not-allowed; }
.pg-gap { padding: 0 2px; color: var(--muted-2); }

/* --------------------------------------------------------- 窄屏卡片 ---- */
.mcards { display: grid; gap: 10px; padding: 10px; background: var(--surface-3); }
.mcard { padding: 12px 13px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.mcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mcard-title { font-size: 14.5px; font-weight: 620; line-height: 1.45; }
.mcard-no { flex: none; margin-top: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }
.mcard-no.is-adjacent-dup { background: #fde68a; color: #6b4b00; padding: 0 5px; border-radius: 4px; font-weight: 600; }
.mcard-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mcard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin: 10px 0 0; }
.mcard-grid > div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 12.5px; }
.mcard-grid dt { color: var(--muted); white-space: nowrap; }
.mcard-grid dd { margin: 0; color: var(--ink-2); text-align: right; }
.mcard-grid dd b { font-weight: 600; font-variant-numeric: tabular-nums; }
.mcard-profit { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.mcard-profit b { font-size: 15.5px; font-weight: 660; font-variant-numeric: tabular-nums; color: var(--ink); }
.mcard-profit.pos b, .mcard-profit.pos span { color: #12725a; }
.mcard-profit.neg b, .mcard-profit.neg span { color: var(--red); }
.mcard-addr { margin-top: 8px; font-size: 12px; line-height: 1.65; color: var(--muted); }
.mcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.mcard-isbn { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }
.mcard-acts { display: flex; gap: 6px; }
.mcard-acts button { height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12.5px; color: var(--ink-2); }
.mcard-acts button:hover { background: var(--surface-3); }
.mcard-acts button.del { color: var(--red); border-color: #f0d8d2; }

/* --------------------------------------------------------------- 看板 ---- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.dash-title h2 { font-size: 18px; font-weight: 660; }
.dash-title p { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.dash-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* 看板右上角控件统一高度 36px、垂直居中，避免高低不齐 */
.dash-tools .seg {
  margin-bottom: 0;
  height: 36px;
  padding: 2px;
  border-radius: 10px;
  align-items: center;
}
.dash-tools .seg-btn { height: 30px; padding: 0 13px; border-radius: 8px; font-size: 12.5px; }
.dash-tools .input-date,
.dash-tools select,
.dash-tools .btn { height: 36px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }

.bars { display: flex; align-items: flex-end; gap: 10px; padding: 18px 16px 14px; height: 230px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 11px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-fill { width: 100%; max-width: 46px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--primary-3), var(--primary)); min-height: 3px; }
.bar.is-clickable { cursor: pointer; border-radius: 8px; transition: background .12s ease; }
.bar.is-clickable:hover { background: var(--primary-tint); }

/* 看板明细弹窗（宽一点，能放下表格） */
.sheet-wide { max-width: 1080px; }

/* 通知面板里的分组标题与亏损预警 */
.notif-section {
  padding: 8px 14px 4px;
  font-size: 11.5px;
  color: var(--muted-2);
  background: #fbfaf6;
  border-top: 1px solid var(--line-3);
}
.notif-item.is-loss { border-left: 3px solid var(--red); background: #fff8f7; }
.notif-item.is-loss b { color: var(--red); }
.bar-fill.zero { background: #e3ded0; border-radius: 2px; min-height: 2px; }
.bar-lab { font-size: 11px; color: var(--muted-2); }

/* 表格里数值列：表头也要右对齐（否则表头左对齐、数据右对齐，看起来错位） */
table th.ta-r,
table td.ta-r { text-align: right; }
table.mini { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: auto; }
table.mini th { padding: 8px 14px; text-align: left; font-size: 12px; color: var(--muted); background: #faf8f2; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.mini td { padding: 8px 14px; border-bottom: 1px solid var(--line-3); }
table.mini tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------- 管理页 ---- */
.seg { display: inline-flex; gap: 3px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 14px; flex-wrap: wrap; }
.seg-btn { height: 32px; padding: 0 14px; border: 0; background: transparent; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.seg-btn.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 620; }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: auto; }
.data-table th { text-align: left; padding: 9px 14px; background: #faf8f2; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.data-table td { padding: 9px 14px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #faf8f1; }

.role-badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.role-admin { color: #7a4a12; background: #fbeed8; }
.role-emp { color: #33605a; background: #e9f2ef; }
.state-on { color: #16694f; background: #e6f3ed; }
.state-off { color: #a23b2c; background: #fbeae6; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ----------------------------------------------------------- 个人中心 ---- */
.profile-list { margin: 0; padding: 16px; display: grid; grid-template-columns: 104px 1fr; gap: 10px 12px; font-size: 13.5px; }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; color: var(--ink); }

.pwd-form { padding: 16px; display: grid; gap: 12px; }
.pwd-form label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pwd-form input { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px; }
.pwd-form input:focus { outline: none; border-color: var(--primary-3); box-shadow: 0 0 0 3px var(--primary-ring); }

/* --------------------------------------------------------------- 弹窗 ---- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 32, 28, .46);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in .16s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }

.sheet {
  width: min(900px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 40px 80px -30px rgba(15, 25, 21, .6);
  animation: rise .2s ease;
  overflow: hidden;
}
.sheet.narrow { width: min(560px, 100%); }

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fff, #fdfcf8);
}
.sheet-head h2 { font-size: 16.5px; font-weight: 660; }
.sheet-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.sheet-body { padding: 18px 20px 6px; overflow: auto; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 20px; border-top: 1px solid var(--line-2); background: #fdfcf8; }
.sheet-foot-actions { display: flex; gap: 8px; }
.form-error { min-height: 18px; font-size: 12.5px; color: var(--red); }

/* 表单顶部的提示条（如：合伙人需先确认购买人） */
.form-notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f0dcbb;
  background: #fdf6e6;
  color: #7a5a12;
  font-size: 13px;
  line-height: 1.6;
}

.form-section { margin-bottom: 18px; }
.form-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12.5px; font-weight: 640; letter-spacing: .1em; color: var(--primary); }
.form-section h3::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--primary); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: #fff;
  font-size: 13.5px;
  resize: vertical;
}
.field select {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378857e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
.field textarea { min-height: 62px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary-3); box-shadow: 0 0 0 3px var(--primary-ring); }
.field input:disabled, .field select:disabled {
  background: var(--surface-3);
  border-color: var(--line-2);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  cursor: not-allowed;
}
.field input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(173, 63, 47, .1); }
.field-hint { margin-top: 4px; font-size: 11.5px; color: var(--muted-2); }
.tag { font-size: 10px; padding: 0 5px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); line-height: 16px; }

.dialog { width: min(430px, 100%); padding: 22px; background: #fff; border-radius: 16px; box-shadow: 0 40px 80px -30px rgba(15, 25, 21, .6); animation: rise .18s ease; }
.dialog h2 { font-size: 16px; font-weight: 660; }
.dialog p { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* 导入结果 */
.result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.result-cell { padding: 12px; border-radius: 10px; background: var(--surface-3); text-align: center; }
.result-cell b { display: block; font-size: 21px; font-weight: 660; font-variant-numeric: tabular-nums; }
.result-cell span { font-size: 11.5px; color: var(--muted); }
.warn-list { margin: 0; padding: 0; list-style: none; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.warn-list li { padding: 7px 12px; font-size: 12.5px; border-bottom: 1px solid var(--line-3); display: flex; gap: 10px; }
.warn-list li:last-child { border-bottom: 0; }
.warn-list .w-no { font-family: var(--mono); color: var(--ink-2); }
.warn-list .w-reason { color: var(--amber); }
.result-note { font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* 提示 */
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 15px; border-radius: 11px; background: #20302b; color: #f2f6f4; font-size: 13px; box-shadow: 0 16px 34px -16px rgba(15, 25, 21, .8); animation: toast-in .22s ease; }
.toast::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #6fc4a6; flex: none; }
.toast.is-bad::before { background: #f08f76; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: .22s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- 响应式 ---- */
@media (max-width: 1400px) {
  .overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  :root { --topbar-h: 101px; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .tabs { order: 3; width: 100%; padding-bottom: 2px; }
  .user-box { margin-left: auto; }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .adv-search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .page { padding: 14px 14px 32px; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-value { font-size: 21px; }
  .search { flex: 1 1 100%; }
  .table-wrap { max-height: none; }
  .form-grid { grid-template-columns: 1fr; }
  .sheet-body { padding: 16px 16px 4px; }
}

@media (max-width: 700px) {
  .toolbar-right { width: 100%; }
  .toolbar-right .admin-only { width: 100%; flex-wrap: wrap; }
  .bulkbar { font-size: 12px; }
  .brand-text p { display: none; }
  .user-chip em { display: none; }
  .auth { padding: 12px; }
  .overlay { padding: 0; }
  .sheet { max-height: 100vh; border-radius: 0; height: 100%; }
  .mcard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .edit-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* 浮动表头：整页滚动时把表头固定在顶部 */
.float-head {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--topbar-h, 57px);
  z-index: 33;
  display: none;
  background: #faf8f2;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 14px -12px rgba(29, 39, 36, .55);
}
.float-head.is-on { display: block; }
.float-inner { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.float-inner::-webkit-scrollbar { display: none; }
.float-head table { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.float-head thead th { position: static; top: auto; }
/* ISBN 单元格：文字可省略，右侧复制按钮 */
.cell-isbn { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cell-isbn .cell-mono {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: text;
}
.copy-btn {
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  opacity: .55;
  transition: opacity .12s ease, background .12s ease;
}
.copy-btn svg { width: 13px; height: 13px; }
.cell-isbn:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--primary-soft); color: var(--primary); }
.copy-btn.is-done { color: var(--primary); opacity: 1; }
table th.ta-r,
table td.ta-r,
.mini th.ta-r,
.data-table th.ta-r { text-align: right; }
table th.ta-c,
table td.ta-c,
.mini th.ta-c,
.data-table th.ta-c { text-align: center; }
/* ---------------------------------------------------------- 登录验证码 ---- */
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-row input { flex: 1 1 auto; min-width: 0; letter-spacing: 2px; text-transform: uppercase; }
.captcha-box {
  flex: none;
  width: 120px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f5ee;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.captcha-box svg { display: block; }
.captcha-box:hover { border-color: var(--primary-3); }
.captcha-loading { font-size: 11.5px; color: var(--muted-2); }

/* ------------------------------------------------------ 状态快捷筛选 ---- */
.status-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line-2); background: #fdfcf9; }
.status-chips .chip {
  height: 26px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.status-chips .chip:hover { border-color: var(--primary-3); color: var(--primary); }
.status-chips .chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* -------------------------------------------------------- 售后提醒 ---- */
.notif-item.is-after { border-left: 3px solid #c98a1a; background: #fffdf5; }
.notif-item .ack-btn { margin-left: auto; }
/* ------------------------------------------------ 合伙人要填的列（浅色底） ---- */
thead th.col-emp { background: #f6e3a8; color: #6b4d08; }
tbody tr td.col-emp { background: #fdf1cd; }
tbody tr:nth-child(even) td.col-emp { background: #fbeac0; }
tbody tr:hover td.col-emp { background: #f8e2ae; }
tbody tr.is-selected td.col-emp { background: #f2edcd; }
tbody tr.is-selected:hover td.col-emp { background: #ece5bd; }
/* ======================================================== 主题色系 ======== */
/* 默认（森林绿）已由 :root 定义；下面是可选色系，通过 body[data-theme] 覆盖 */
:root {
  --primary-ring: rgba(23, 112, 91, .12);
  --primary-ring-2: rgba(23, 112, 91, .14);
  --primary-tint: rgba(23, 112, 91, .07);
  --primary-glow: rgba(20, 92, 76, .07);
  --primary-link: rgba(20, 92, 76, .35);
  --primary-shadow: rgba(13, 66, 55, .85);
  --primary-on-soft: #a8cdc3;
  --primary-on-soft-2: #8fb9ae;
}

body[data-theme="forest"] {
  --primary: #145c4c; --primary-2: #0e463a; --primary-3: #17705b;
  --primary-soft: #e7f1ee; --primary-soft-2: #d9ebe5;
  --primary-ring: rgba(23, 112, 91, .12); --primary-ring-2: rgba(23, 112, 91, .14);
  --primary-tint: rgba(23, 112, 91, .07); --primary-glow: rgba(20, 92, 76, .07);
  --primary-link: rgba(20, 92, 76, .35); --primary-shadow: rgba(13, 66, 55, .85);
  --primary-on-soft: #a8cdc3; --primary-on-soft-2: #8fb9ae;
}

body[data-theme="ocean"] {
  --primary: #1c5a86; --primary-2: #144466; --primary-3: #2472a6;
  --primary-soft: #e6f0f8; --primary-soft-2: #d5e6f3;
  --primary-ring: rgba(36, 114, 166, .14); --primary-ring-2: rgba(36, 114, 166, .16);
  --primary-tint: rgba(36, 114, 166, .07); --primary-glow: rgba(28, 90, 134, .07);
  --primary-link: rgba(28, 90, 134, .35); --primary-shadow: rgba(16, 60, 92, .85);
  --primary-on-soft: #a9c9e2; --primary-on-soft-2: #93b9d8;
}

body[data-theme="violet"] {
  --primary: #5b3f96; --primary-2: #452e74; --primary-3: #6f4fb4;
  --primary-soft: #efe9f8; --primary-soft-2: #e2d8f3;
  --primary-ring: rgba(111, 79, 180, .14); --primary-ring-2: rgba(111, 79, 180, .16);
  --primary-tint: rgba(111, 79, 180, .07); --primary-glow: rgba(91, 63, 150, .07);
  --primary-link: rgba(91, 63, 150, .35); --primary-shadow: rgba(58, 38, 98, .85);
  --primary-on-soft: #c4b3e3; --primary-on-soft-2: #b3a0da;
}

body[data-theme="amber"] {
  --primary: #9a6217; --primary-2: #7a4c10; --primary-3: #b5781f;
  --primary-soft: #fbf1dd; --primary-soft-2: #f6e6c7;
  --primary-ring: rgba(181, 120, 31, .16); --primary-ring-2: rgba(181, 120, 31, .18);
  --primary-tint: rgba(181, 120, 31, .08); --primary-glow: rgba(154, 98, 23, .07);
  --primary-link: rgba(154, 98, 23, .35); --primary-shadow: rgba(110, 68, 14, .85);
  --primary-on-soft: #e6cfa4; --primary-on-soft-2: #dcc294;
}

body[data-theme="rose"] {
  --primary: #9c3a4a; --primary-2: #7c2b38; --primary-3: #b84a5c;
  --primary-soft: #fbeaed; --primary-soft-2: #f6d9de;
  --primary-ring: rgba(184, 74, 92, .14); --primary-ring-2: rgba(184, 74, 92, .16);
  --primary-tint: rgba(184, 74, 92, .07); --primary-glow: rgba(156, 58, 74, .07);
  --primary-link: rgba(156, 58, 74, .35); --primary-shadow: rgba(112, 38, 50, .85);
  --primary-on-soft: #e6b3bd; --primary-on-soft-2: #dda0ac;
}

body[data-theme="graphite"] {
  --primary: #3d4a55; --primary-2: #2b353d; --primary-3: #4d5c69;
  --primary-soft: #eef1f4; --primary-soft-2: #e0e6eb;
  --primary-ring: rgba(77, 92, 105, .14); --primary-ring-2: rgba(77, 92, 105, .16);
  --primary-tint: rgba(77, 92, 105, .07); --primary-glow: rgba(61, 74, 85, .07);
  --primary-link: rgba(61, 74, 85, .35); --primary-shadow: rgba(38, 47, 54, .85);
  --primary-on-soft: #b6c1cb; --primary-on-soft-2: #a3b0bb;
}

/* 主题选择器 */
.theme-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-dot {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; position: relative;
}
.theme-dot.is-on { border-color: var(--ink); box-shadow: 0 0 0 3px #fff inset; }
.theme-dot:hover { transform: translateY(-1px); }
.theme-name { font-size: 12px; color: var(--muted); margin-top: 6px; }
/* 顶栏里的配色小圆点 */
.theme-picker-top { gap: 7px; align-items: center; margin-right: 4px; }
.theme-picker-top .theme-dot { width: 18px; height: 18px; border-width: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.theme-picker-top .theme-dot.is-on { border-color: #fff; box-shadow: 0 0 0 2px var(--ink); }
.theme-picker-top .theme-name { display: none; }
.theme-picker-top .theme-item { display: flex; }
@media (max-width: 980px) { .theme-picker-top { display: none; } }
/* ------------------------------------------------ 书名备注的图片 ---- */
.note-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.note-img { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); }
.note-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.note-img-del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
}
.note-img-del:hover { background: rgba(0, 0, 0, .75); }
.note-img-actions { display: flex; align-items: center; gap: 10px; }
.title-note-dot.has-img { background: var(--primary-soft); color: var(--primary); }

/* ------------------------------------------------ 改价提醒 ---- */
.notif-item.is-price { border-left: 3px solid #9c3a4a; background: #fff8f8; }

/* 改价历史（订单弹窗里） */
.price-hist { margin-top: 4px; }
.price-hist table { width: 100%; border-collapse: collapse; font-size: 12px; }
.price-hist th, .price-hist td { padding: 5px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
.price-hist th { color: var(--muted); font-weight: 500; }
/* 书名备注弹窗：订单编号 + 书名放大 */
.sheet-sub-no {
  display: inline-block; font-family: var(--mono); font-size: 15px; font-weight: 700;
  color: var(--primary); letter-spacing: .5px; margin-right: 10px;
  background: var(--primary-soft); padding: 2px 8px; border-radius: 6px;
}
.sheet-sub-title { font-size: 15px; font-weight: 600; color: var(--ink); }

/* 图片可点预览 */
.note-img img { cursor: zoom-in; }
.note-img img:hover { opacity: .92; }

/* 图片大图预览层 */
.img-viewer {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(10, 15, 13, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 40px; cursor: zoom-out;
}
.img-viewer img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); background: #fff; }
.img-viewer-close {
  position: absolute; top: 18px; right: 22px; width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, .18); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.img-viewer-close:hover { background: rgba(255, 255, 255, .3); }
/* 顶部统计卡里的通知卡（可点）+ 合伙人确认按钮 */
.stat.is-clickable { cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease; }
.stat.is-clickable:hover { border-color: var(--primary-3); box-shadow: 0 6px 18px -12px rgba(29, 39, 36, .5); }
.stat-confirm {
  margin-top: 8px; height: 26px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--primary-3); background: #fff; color: var(--primary);
  font-size: 12px; cursor: pointer;
}
.stat-confirm:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 铃铛里的「合伙人状态确认」 */
.notif-item.is-confirm { border-left: 3px solid var(--primary-3); background: #f6fbf9; }

/* 归档表的售后状态下拉 */
.arch-aftersale { width: 112px; }
/* 消息通知列表 */
.msg-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
.msg-item { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); }
.msg-item.is-unread { border-color: var(--primary-3); background: var(--primary-soft); }
.msg-meta { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-meta b { color: var(--ink-2); font-size: 12.5px; }
.msg-body { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
/* 订单编号后的「多本 / 3本」标签 */
.book-count-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  background: var(--amber-soft); color: var(--amber);
  font-size: 11px; font-weight: 600; line-height: 16px; vertical-align: middle;
}
.book-count-tag.is-editable { cursor: pointer; }
.book-count-tag.is-editable:hover { background: #f2e0bd; }
/* 设置本数的快捷按钮 */
.book-count-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.book-count-quick .btn { height: 30px; }
/* =============== 2026-11-27 新增样式 =============== */

/* 多本标签：更深更醒目 */
.book-count-tag {
  background: #b45309 !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(180, 83, 9, .35);
}
.book-count-tag.is-editable:hover { background: #92400e !important; }

/* 多本订单的卖价：琥珀底色提醒 */
.cell-money.is-multi {
  background: #fde68a; color: #7c2d12; font-weight: 700;
  padding: 1px 6px; border-radius: 5px;
}

/* 入手价格（总价 − 扣点） */
.cell-net { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

/* 用户地址 + 复制按钮 */
.cell-addr-wrap { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.cell-addr-wrap .cell-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-addr-wrap .copy-btn { opacity: .35; }
.cell-addr-wrap:hover .copy-btn { opacity: 1; }

/* 购入平台 / 账号名称 色块 */
.plat-chip { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.acct-chip { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px; }

/* 带色下拉（平台 / 账号） */
select.sel-colored { color: var(--ink); }
select.sel-colored option { padding: 3px 6px; }

/* 合伙人端：可点单元格的点击范围加大（整格可点、行更高） */
tbody td.is-editable, tbody td.cell-markable { cursor: pointer; }
/* 点击范围靠单元格内边距扩大；不要用覆盖层，否则会挡住单元格里的下拉框 */
tbody td.is-editable { position: relative; }
tbody tr td { padding-top: 8px; padding-bottom: 8px; }
/* =============== 2026-11-27 第二批：台账表格观感 =============== */
/* 只影响台账主表 #table，其它地方字体颜色不变 */

#table,
#table th,
#table td {
  font-family: "Microsoft YaHei", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
#table th { color: #3a4742; }
#table td { color: #16211d; }

/* 行高加高 */
#table tbody td { padding-top: 11px; padding-bottom: 11px; }

/* 鼠标移到某行：整行底色加深 */
#table tbody tr:hover td { background: #eee7d6; }
#table tbody tr:hover td.col-select { background: #eee7d6; }
#table tbody tr:hover td.col-sticky { background: #eee7d6; }
#table tbody tr:hover td.col-actions { background: #eee7d6; }
#table tbody tr:hover td.col-emp { background: #f6dfa4; }

/* 书名单元格：书名占满、备注标签贴右、和复制图标一起排在最后 */
.cell-title-wrap {
  display: flex; align-items: center; gap: 6px;
  min-width: 0; width: 100%;
}
.cell-title-wrap .cell-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-title-wrap .title-note-dot,
.cell-title-wrap .copy-btn { flex: none; }
.cell-title-wrap .title-note-dot { margin-left: auto; }

/* 书名备注的悬浮提示（显示在书名右上角） */
.note-tip {
  position: fixed; z-index: 9000; max-width: 320px; max-height: 220px; overflow: auto;
  padding: 8px 10px; border-radius: 10px; background: #1f2a26; color: #fff;
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28); pointer-events: none;
}
.note-tip::after {
  content: ''; position: absolute; top: -5px; right: 14px;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #1f2a26;
}
/* 复制图标常显一点，别让人找不到（订单编号 / 书名 / 地址） */
#table .copy-btn { opacity: .55; }
#table td:hover .copy-btn { opacity: 1; }
.cell-addr-wrap .copy-btn { opacity: .55; }
/* 5) 不要隔行变色：整个表都是白底（保留合伙人列 / 悬停的区分） */
#table tbody tr:nth-child(even) td { background: #fff; }
#table tbody tr:nth-child(even) td.col-select,
#table tbody tr:nth-child(even) td.col-sticky,
#table tbody tr:nth-child(even) td.col-actions { background: #fff; }
#table tbody tr:nth-child(even) td.col-emp { background: #fdf1cd; }

/* 6) 用户地址文字更深一点 */
#table .cell-address { color: #0f1714; }

/* 8) 「买过」小标签 */
.bought-tag {
  display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 6px;
  background: #fde2c8; color: #8a3a00; font-size: 11px; font-weight: 700; vertical-align: 1px;
}
/* =============== 2026-11-28 超时提醒 / 颜色筛选 =============== */

/* 认领后超时未填购入价格：24h 黄、36h 橙、48h 红；未填订单状态 30h：蓝 */
/* 先定义「未填状态」的蓝，再定义价格超时的黄/橙/红：价格超时的颜色优先显示 */
#table tbody tr.alert-status td { background: #dceaf7 !important; }
#table tbody tr.alert-price-1 td { background: #fff7d6 !important; }
#table tbody tr.alert-price-2 td { background: #ffe6c7 !important; }
#table tbody tr.alert-price-3 td { background: #ffd9d6 !important; }
/* 超时提醒时整行同一个色，合伙人列也一起染，避免花掉 */
#table tbody tr:hover td { filter: brightness(.97); }

/* 颜色筛选小圆点 */
.color-filter { display: inline-flex; align-items: center; gap: 6px; }
.color-dot-btn {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; outline: none;
}
.color-dot-btn.is-on { border-color: #1f2a26; box-shadow: 0 0 0 2px #fff inset; }
.color-dot-btn.clear { background: #fff; border: 1px dashed var(--line); }
/* =============== 2026-11-29 合伙人「不在岗」 =============== */
.away-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 16px; border-radius: 12px;
  background: #fff1c9; color: #7a4a00; border: 1px solid #f0d48a;
  font-size: 13px;
}
.away-bar b { font-size: 13.5px; }
body.is-away #stats .is-clickable { pointer-events: none; opacity: .7; }
body.is-away #tbody td.is-editable { cursor: default; }
.pwd-cell { font-family: ui-monospace, Consolas, monospace; background: #f6f3e9; padding: 1px 6px; border-radius: 5px; }

/* =============== 备案信息（每页底部居中） =============== */
.icp-footer {
  margin-top: auto;
  padding: 18px 12px 22px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted-2);
}
.icp-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color .15s, border-color .15s;
}
.icp-footer a:hover { color: var(--primary); border-bottom-color: var(--primary); }
