
/* ============ Design tokens ============ */
:root{
  --spring:cubic-bezier(.34,1.56,.64,1);
  --ease:cubic-bezier(.22,1,.36,1);
  --sidebar-w:60px;
  --sidebar-w-open:240px;
  --r-sm:6px; --r-md:8px; --r-lg:10px;
}
:root[data-theme="light"]{
  --bg:#ffffff;
  --sidebar:#fafafa;
  --surface:#ffffff;
  --surface-2:#fafafa;
  --surface-3:#f4f4f5;
  --border:#e4e4e7;
  --border-strong:#d4d4d8;
  --text:#18181b;
  --text-2:#52525b;
  --text-3:#a1a1aa;
  --accent:#4F46E5;
  --accent-hover:#4338ca;
  --accent-soft:#eef2ff;
  --accent-ring:rgba(79,70,229,.18);
  --shadow:0 1px 2px rgba(24,24,27,.04),0 4px 14px rgba(24,24,27,.035);
  --shadow-hover:0 10px 28px rgba(24,24,27,.11),0 2px 8px rgba(24,24,27,.06);
  --shadow-modal:0 24px 70px rgba(24,24,27,.18);
  --emerald:#059669; --emerald-soft:rgba(5,150,105,.10);
  --amber:#d97706; --amber-soft:rgba(217,119,6,.10);
  --rose:#e11d48; --rose-soft:rgba(225,29,72,.10);
  --zinc-soft:rgba(113,113,122,.10);
  --scrim:rgba(24,24,27,.38);
  --glass-bg:rgba(255,255,255,.62);
  --glass-bg-strong:rgba(255,255,255,.76);
  --glass-border:rgba(255,255,255,.78);
  --glass-highlight:rgba(255,255,255,.55);
  --glass-blur:10px;
  --glow-1:rgba(109,94,240,.11);
  --glow-2:rgba(14,165,233,.09);
  --glow-3:rgba(16,185,129,.07);
}
:root[data-theme="dark"]{
  --bg:#09090b;
  --sidebar:#0d0d10;
  --surface:#111113;
  --surface-2:#18181b;
  --surface-3:#202024;
  --border:#27272a;
  --border-strong:#3f3f46;
  --text:#fafafa;
  --text-2:#a1a1aa;
  --text-3:#a1a1aa;
  --accent:#6366f1;
  --accent-hover:#818cf8;
  --accent-soft:rgba(99,102,241,.14);
  --accent-ring:rgba(99,102,241,.25);
  --shadow:0 1px 2px rgba(0,0,0,.35);
  --shadow-hover:0 10px 30px rgba(0,0,0,.55);
  --shadow-modal:0 24px 80px rgba(0,0,0,.7);
  --emerald:#34d399; --emerald-soft:rgba(52,211,153,.12);
  --amber:#fbbf24; --amber-soft:rgba(251,191,36,.12);
  --rose:#fb7185; --rose-soft:rgba(251,113,133,.12);
  --zinc-soft:rgba(161,161,170,.12);
  --scrim:rgba(0,0,0,.66);
  --glass-bg:rgba(26,28,40,.62);
  --glass-bg-strong:rgba(32,34,48,.76);
  --glass-border:rgba(255,255,255,.10);
  --glass-highlight:rgba(255,255,255,.06);
  --glass-blur:12px;
  --glow-1:rgba(99,102,241,.16);
  --glow-2:rgba(14,165,233,.12);
  --glow-3:rgba(16,185,129,.10);
}
*{box-sizing:border-box;margin:0;padding:0}
svg{width:1em;height:1em;flex:0 0 auto}
html,body{height:100%}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  background:var(--bg);color:var(--text);
  font-size:14px;line-height:1.5;
  -webkit-font-smoothing:antialiased;
  transition:background .35s var(--ease),color .35s var(--ease);
}
.mono{font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;font-variant-numeric:tabular-nums}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
::selection{background:var(--accent-ring)}

/* ============ Layout ============ */
.app{display:flex;min-height:100vh}
.sidebar{
  width:var(--sidebar-w);flex:0 0 var(--sidebar-w);
  position:fixed;inset:0 auto 0 0;z-index:20;
  background:var(--sidebar);border-right:1px solid var(--border);
  display:flex;flex-direction:column;
  padding:22px 10px 16px;
  overflow-x:hidden;overflow-y:auto;white-space:nowrap;
  scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent;
  transition:width .24s var(--ease),background .35s var(--ease),border-color .35s var(--ease),box-shadow .24s var(--ease);
}
.sidebar::-webkit-scrollbar{width:4px}
.sidebar::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:4px}
:is(.sidebar:hover,html.rail-pinned .sidebar){width:var(--sidebar-w-open);box-shadow:none;border-right-color:var(--border-strong)}
.main{
  flex:1;margin-left:var(--sidebar-w);min-width:0;display:flex;flex-direction:column;
  transition:margin-left .24s var(--ease);
}
:is(.sidebar:hover ~ .main,html.rail-pinned .main){margin-left:var(--sidebar-w-open)}

/* sidebar pin button：仅菜单展开（悬浮或固定）时显示 */
.sidebar-pin{
  position:fixed;left:var(--sidebar-w);top:76px;z-index:25;
  width:22px;height:22px;padding:0;border-radius:50%;
  transform:translateX(-50%);
  background:var(--text-3);color:#fff;border:2px solid var(--sidebar);
  display:grid;place-items:center;cursor:pointer;
  opacity:0;visibility:hidden;pointer-events:none;
  transition:left .24s var(--ease),background .18s ease,transform .18s var(--spring),opacity .18s ease,visibility 0s linear .24s;
}
.sidebar-pin svg{width:11px;height:11px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
/* 展开态与按钮 hover 态：立即可见，并保留 hover 缓冲窗口 */
:is(.sidebar:hover ~ .sidebar-pin,html.rail-pinned .sidebar-pin,.sidebar-pin:hover){
  left:var(--sidebar-w-open);opacity:1;visibility:visible;pointer-events:auto;
  transition:left .24s var(--ease),background .18s ease,transform .18s var(--spring),opacity .18s ease,visibility 0s;
}
.sidebar-pin:hover{background:var(--accent);transform:translateX(-50%) scale(1.12)}
html.rail-pinned .sidebar-pin{background:var(--accent);transform:translateX(-50%) rotate(0deg)}
/* 固定按钮 hover 时保持侧栏展开，避免鼠标移向按钮时菜单收起 */
.app:has(.sidebar-pin:hover) .sidebar{width:var(--sidebar-w-open)}
.app:has(.sidebar-pin:hover) .main{margin-left:var(--sidebar-w-open)}
/* 点击固定按钮瞬间：禁用侧栏相关过渡并锁定展开态，避免整屏菜单重排闪动 */
html.pin-switch .app,html.pin-switch .app *{transition:none!important}
html.pin-switch .sidebar{width:var(--sidebar-w-open)}
html.pin-switch .main{margin-left:var(--sidebar-w-open)}
html.pin-switch .sidebar-pin{left:var(--sidebar-w-open)}
html.pin-switch .nav-children{max-height:600px;opacity:1;pointer-events:auto}
html.pin-switch .brand-name,html.pin-switch .nav-item>span:not(.nav-count),html.pin-switch .nav-group-head span,html.pin-switch .nav-count,html.pin-switch .theme-row>span,html.pin-switch .user-name,html.pin-switch .user-mail{max-width:180px;opacity:1}

/* ============ Sidebar ============ */
.brand{display:flex;align-items:center;gap:11px;padding:2px 9px 26px}
.brand-mark{
  width:26px;height:26px;border-radius:7px;background:var(--accent);
  display:grid;place-items:center;flex:0 0 auto;
  box-shadow:0 2px 8px var(--accent-ring);
}
.brand-mark svg{width:15px;height:15px;stroke:#fff}
.brand-name{font-weight:650;font-size:15px;letter-spacing:-.01em}
.nav-label{font-size:10.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--text-3);padding:0 10px;margin-bottom:8px}
.nav{display:flex;flex-direction:column;gap:3px}
.nav-item{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:9px 10px;border:0;border-radius:var(--r-sm);
  background:transparent;color:var(--text-2);
  font-size:13px;font-weight:500;text-align:left;white-space:nowrap;
  transition:background .18s var(--ease),color .18s var(--ease),transform .3s var(--spring);
}
.nav-item svg{width:16px;height:16px;flex:0 0 auto;stroke:currentColor;stroke-width:1.7}
.nav-item:hover{background:var(--surface-3);color:var(--text);transform:translateX(2px)}
.nav-item.active{background:var(--accent-soft);color:var(--accent);font-weight:600}
.nav-count{margin-left:auto;font-size:11px;color:var(--text-3);font-family:'JetBrains Mono',monospace}
/* ============ Two-level sidebar groups ============ */
.nav-groups{display:flex;flex-direction:column;gap:18px;flex:0 0 auto}
.nav-group{flex:0 0 auto}
.nav-group-head{
  display:flex;align-items:center;width:100%;
  padding:5px 10px;margin-bottom:6px;border:0;border-radius:var(--r-sm);
  background:transparent;color:var(--text-3);
  font-size:10.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;
  cursor:default;
}
.nav-group-head svg{width:16px;height:16px;flex:0 0 auto;stroke:currentColor;stroke-width:1.7}
.nav-home{color:var(--accent);font-weight:600}
.nav-children{padding-top:1px}
.sidebar-spacer{flex:1 0 12px;min-height:12px}

/* ============ Collapsed rail (icon-only, expand on hover) ============ */
/* 收起态隐藏二级菜单，仅展示一级图标（HOME / 工作 / 系统管理） */
.sidebar .nav-children{max-height:0;opacity:0;overflow:hidden;pointer-events:none;transition:max-height .24s var(--ease),opacity .18s var(--ease)}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-children{max-height:600px;opacity:1;pointer-events:auto}
.sidebar .nav-groups{gap:12px}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-groups{gap:18px}
.sidebar .brand-name,.sidebar .nav-item > span:not(.nav-count),.sidebar .nav-group-head span,
.sidebar .nav-count,.sidebar .theme-row > span,.sidebar .user-name,.sidebar .user-mail{
  max-width:0;opacity:0;overflow:hidden;
  transition:max-width .2s var(--ease),opacity .16s var(--ease);
}
.sidebar .nav-item > span:not(.nav-count){white-space:nowrap}
.sidebar .nav-count{margin-left:0}
.sidebar .brand,.sidebar .nav-item,.sidebar .nav-group-head{justify-content:center;gap:0}
.sidebar .nav-item{padding:9px 0}
.sidebar .nav-group-head{padding:5px 0}
.sidebar .theme-row,.sidebar .user-row{justify-content:center;padding-left:0;padding-right:0;gap:0}
.sidebar .theme-row{border-color:transparent;background:transparent}
.sidebar .user-row .avatar{margin:0 auto}
:is(.sidebar:hover,html.rail-pinned .sidebar) .brand-name,:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-item > span:not(.nav-count),:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-group-head span,
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-count,:is(.sidebar:hover,html.rail-pinned .sidebar) .theme-row > span,:is(.sidebar:hover,html.rail-pinned .sidebar) .user-name,:is(.sidebar:hover,html.rail-pinned .sidebar) .user-mail{
  max-width:180px;opacity:1;
}
:is(.sidebar:hover,html.rail-pinned .sidebar) .brand,:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-item,:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-group-head{justify-content:flex-start;gap:10px}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-item,:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-group-head{padding-left:10px;padding-right:10px}
:is(.sidebar:hover,html.rail-pinned .sidebar) .theme-row,:is(.sidebar:hover,html.rail-pinned .sidebar) .user-row{justify-content:space-between;padding-left:10px;padding-right:10px;gap:10px}
:is(.sidebar:hover,html.rail-pinned .sidebar) .theme-row{border-color:var(--border);background:var(--surface)}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-count{margin-left:auto}
:is(.sidebar:hover,html.rail-pinned .sidebar) .user-row .avatar{margin:0}
/* 展开态层级：一级（HOME/工作/系统管理）做成块，二级缩进从属 */
/* 展开态层级：一级实心高亮块 / 二级大幅缩进并弱化，形成清晰从属 */
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-home,
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-group-head{
  font-size:13px;font-weight:700;letter-spacing:.01em;text-transform:none;
  padding:11px 10px;margin-bottom:10px;
}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-home{
  background:var(--accent);color:#fff;box-shadow:0 4px 14px var(--accent-ring);
}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-home:hover,
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-home.active{background:var(--accent);color:#fff}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-home svg{width:18px;height:18px;stroke-width:2}
/* 一级分组：灰底块 + 深色粗体 + 左侧主题色竖条 */
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-group-head{
  background:var(--surface-3);color:var(--text);
  border-left:3px solid var(--accent);border-radius:0 var(--r-sm) var(--r-sm) 0;
  padding-left:8px;
}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-group-head svg{width:18px;height:18px;stroke-width:2;color:var(--accent)}
/* 二级：缩进 36px + 淡色小字 + 小图标，明显从属于一级 */
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-children{margin-left:22px;padding-left:15px;border-left:0}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-children .nav-item{
  font-size:12px;font-weight:400;color:var(--text-3);gap:9px;
  padding-top:9px;padding-bottom:9px;
}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-children .nav-item svg{width:14px;height:14px;stroke-width:1.6}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-children .nav-item:hover{color:var(--text-2)}
:is(.sidebar:hover,html.rail-pinned .sidebar) .nav-children .nav-item.active{color:var(--accent);font-weight:600}
.theme-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px;border:1px solid var(--border);border-radius:var(--r-md);
  background:var(--surface);margin-bottom:12px;
}
.theme-row > span{display:flex;align-items:center;gap:9px;font-size:12.5px;color:var(--text-2);font-weight:500}
.theme-row svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.7}
.toggle{
  width:36px;height:20px;border-radius:99px;border:0;padding:2px;
  background:var(--surface-3);position:relative;transition:background .25s var(--ease);
}
.toggle::after{
  content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.2);
  transition:transform .35s var(--spring),background .25s var(--ease);
}
:root[data-theme="dark"] .toggle{background:var(--accent)}
:root[data-theme="dark"] .toggle::after{transform:translateX(16px)}
.user-row{display:flex;align-items:center;gap:10px;padding:8px;border-top:1px solid var(--border)}
.avatar{
  width:30px;height:30px;border-radius:50%;flex:0 0 auto;
  background:linear-gradient(135deg,#6366f1,#4338ca);color:#fff;
  display:grid;place-items:center;font-size:11px;font-weight:700;letter-spacing:.02em;
}
.user-name{font-size:12.5px;font-weight:600;line-height:1.3}
.user-mail{font-size:10.5px;color:var(--text-3);line-height:1.3}

/* ============ Topbar ============ */
.topbar{
  height:60px;flex:0 0 60px;position:sticky;top:0;z-index:10;
  background:transparent;
  backdrop-filter:none;
  border-bottom:1px solid transparent;
  display:flex;align-items:center;gap:14px;padding:0 34px;
}
.crumb{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-3)}
.crumb b{color:var(--text);font-weight:600}
.crumb svg{width:13px;height:13px;stroke:currentColor;stroke-width:1.8}
.crumb-link{
  border:0;background:transparent;padding:0;color:var(--text-3);
  font-size:inherit;line-height:inherit;cursor:pointer;
  transition:color .18s var(--ease);
}
.crumb-link:hover{color:var(--accent)}
.crumb-link:focus-visible{outline:2px solid var(--accent-ring);outline-offset:3px;border-radius:3px}
.topbar-right{margin-left:auto;display:flex;align-items:center;gap:10px}
.search{
  display:flex;align-items:center;gap:8px;height:32px;width:220px;
  padding:0 10px;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface-2);color:var(--text-3);
  transition:border-color .2s var(--ease),box-shadow .2s var(--ease),width .3s var(--ease);
}
.search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring);width:260px}
.search svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.8;flex:0 0 auto}
.search input{border:0;background:transparent;outline:0;width:100%;font-size:12.5px;color:var(--text)}
.search input::placeholder{color:var(--text-3)}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  height:32px;padding:0 13px;border-radius:var(--r-sm);
  border:1px solid var(--border);background:var(--surface);color:var(--text-2);
  font-size:12.5px;font-weight:600;white-space:nowrap;
  transition:all .28s var(--spring);
}
.btn svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.9}
.btn:hover{transform:translateY(-2px);box-shadow:var(--shadow-hover);border-color:var(--border-strong);color:var(--text)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);box-shadow:0 8px 20px var(--accent-ring)}
.btn.ghost{border-color:transparent;background:transparent}
.btn.danger{color:var(--rose)}
.btn.sm{height:28px;padding:0 10px;font-size:12px}

/* ============ Content ============ */
.content{padding:30px 34px 60px;width:100%}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:26px;flex-wrap:wrap}
.page-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.page-title{font-size:24px;font-weight:680;letter-spacing:-.025em;line-height:1.2}
.page-sub{color:var(--text-3);font-size:12.5px;margin-top:6px}
.page-sub .dot{margin:0 7px;opacity:.5}
/* 页签已显示页面名称，隐藏页内重复标题并将内容上移 */
.page-head{display:none!important}
body[data-page="home"] .home-hero .page-title{display:none!important}
body:not([data-page="home"]) .content{padding-top:18px!important}
.section{margin-bottom:32px;scroll-margin-top:78px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.section-title{font-size:13px;font-weight:650;letter-spacing:-.005em;display:flex;align-items:center;gap:8px}
.section-title .bar{width:3px;height:13px;border-radius:2px;background:var(--accent)}
.section-note{font-size:11.5px;color:var(--text-3)}

/* KPI */
.stats-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.stats-grid.bug-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  padding:16px 17px;box-shadow:var(--shadow);
  transition:transform .38s var(--spring),box-shadow .38s var(--spring),border-color .25s var(--ease);
}
.stat:hover{transform:translateY(-4px);box-shadow:var(--shadow-hover);border-color:var(--border-strong)}
.stat-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.stat-label{font-size:12px;color:var(--text-2);font-weight:500}
.stat-icon{width:26px;height:26px;border-radius:var(--r-sm);display:grid;place-items:center;background:var(--surface-3);color:var(--text-3)}
.stat-icon svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.8}
.stat.accent .stat-icon{background:var(--accent-soft);color:var(--accent)}
.stat-value{font-size:27px;font-weight:650;letter-spacing:-.04em;line-height:1.1}
.stat-value small{font-size:13px;font-weight:500;color:var(--text-3);margin-left:3px;letter-spacing:0}
.stat-foot{font-size:11px;color:var(--text-3);margin-top:8px;display:flex;align-items:center;gap:6px}
.stat-foot em{font-style:normal;color:var(--accent);font-weight:600}
.scope-toggle{margin-left:auto;flex:0 0 auto;border:1px solid var(--border);background:var(--surface-2);color:var(--accent);font-size:10px;line-height:1;padding:4px 6px;border-radius:var(--r-sm);cursor:pointer;transition:background .2s var(--ease),border-color .2s var(--ease)}
.scope-toggle:hover{background:var(--accent-soft);border-color:var(--accent)}

/* Distribution panel */
.dist-grid{display:grid;grid-template-columns:1.15fr 1fr;gap:12px;margin-top:12px}
.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:17px 18px;box-shadow:var(--shadow)}
.panel-title{font-size:12.5px;font-weight:600;margin-bottom:15px;display:flex;align-items:center;justify-content:space-between}
.panel-title span{font-size:11px;color:var(--text-3);font-weight:400}
.dist-row{margin-bottom:13px}
.dist-row:last-child{margin-bottom:0}
.dist-meta{display:flex;align-items:center;justify-content:space-between;font-size:12px;margin-bottom:7px}
.dist-meta .left{display:flex;align-items:center;gap:8px;color:var(--text-2)}
.dist-meta .right{color:var(--text-3);font-size:11.5px}
.dotmark{width:7px;height:7px;border-radius:50%;flex:0 0 auto}
.track{height:6px;border-radius:99px;background:var(--surface-3);overflow:hidden}
.fill{height:100%;width:0;border-radius:99px;transition:width .6s var(--ease)}
.legend{display:flex;gap:18px;flex-wrap:wrap;margin-top:4px}
.legend-item{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--text-2)}
.legend-item b{font-weight:600;color:var(--text)}
.quote-bar{display:flex;height:8px;border-radius:99px;overflow:hidden;background:var(--surface-3);margin-top:12px}
.quote-seg{width:0;transition:width .6s var(--ease) .1s}

/* Board */
.board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start}
.col{
  background:var(--surface-2);border:1px solid var(--border);border-radius:var(--r-lg);
  padding:12px;min-height:260px;
  transition:background .25s var(--ease),border-color .25s var(--ease),box-shadow .25s var(--ease);
}
.col.drag-over{border-color:var(--accent);box-shadow:inset 0 0 0 2px var(--accent-ring);background:var(--accent-soft)}
.col-head{display:flex;align-items:center;gap:8px;padding:2px 4px 12px}
.col-dot{width:7px;height:7px;border-radius:50%}
.col-name{font-size:12.5px;font-weight:650}
.col-num{font-size:11px;color:var(--text-3);font-family:'JetBrains Mono',monospace;margin-left:auto}
.cards{display:flex;flex-direction:column;gap:8px}
.card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  padding:13px;box-shadow:var(--shadow);cursor:grab;
  transition:transform .38s var(--spring),box-shadow .38s var(--spring),border-color .2s var(--ease),opacity .2s var(--ease);
}
.card:hover{transform:translateY(-3px);box-shadow:var(--shadow-hover);border-color:var(--border-strong)}
.card:active{cursor:grabbing}
.card.dragging{opacity:.42;transform:scale(.98)}
.card-top{display:flex;align-items:center;gap:6px;margin-bottom:9px;flex-wrap:wrap}
.tag{font-size:10px;font-weight:600;padding:2px 7px;border-radius:5px;background:var(--surface-3);color:var(--text-2)}
.tag.quote-yes{background:var(--emerald-soft);color:var(--emerald)}
.tag.quote-no{background:var(--rose-soft);color:var(--rose)}
.tag.quote-wait{background:var(--amber-soft);color:var(--amber)}
td.derived{cursor:default}
td.derived:hover{background:transparent}
.tag.batch{background:var(--accent-soft);color:var(--accent)}
.tag.doc-er{background:var(--amber-soft);color:var(--amber)}
.tag.doc-req{background:var(--accent-soft);color:var(--accent)}
.tag.doc-api{background:var(--emerald-soft);color:var(--emerald)}
.tag.doc-wire{background:var(--rose-soft);color:var(--rose)}
.doc-preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px}
.doc-preview-item{display:flex;flex-direction:column;gap:6px;min-width:0}
.doc-preview-item > span,.doc-preview-note > span{font-size:11px;font-weight:600;color:var(--text-3)}
.doc-preview-item a{color:var(--accent);word-break:break-all;font-size:12px}
.doc-preview-note{margin-top:18px;padding-top:16px;border-top:1px solid var(--border);display:flex;flex-direction:column;gap:8px}
.doc-preview-note p{font-size:13px;color:var(--text-2);line-height:1.7;white-space:pre-wrap}
.doc-preview-html{margin-bottom:18px;border:1px solid var(--border);border-radius:8px;overflow:hidden;background:#fff}
.doc-preview-html-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;background:var(--surface-2);border-bottom:1px solid var(--border);font-size:11px;font-weight:600;color:var(--text-3)}
.doc-preview-html-head a{color:var(--accent);font-weight:500;white-space:nowrap}
.doc-preview-html iframe{display:block;width:100%;height:54vh;min-height:340px;border:0;background:#fff}
@media(max-width:768px){.doc-preview-grid{grid-template-columns:1fr}.doc-preview-html iframe{height:46vh;min-height:260px}}
.card-title{font-size:13px;font-weight:600;line-height:1.45;letter-spacing:-.005em;margin-bottom:10px;word-break:break-word}
.card-meta{display:flex;align-items:center;gap:10px;font-size:11px;color:var(--text-3);flex-wrap:wrap}
.card-meta span{display:flex;align-items:center;gap:4px}
.card-meta svg{width:12px;height:12px;stroke:currentColor;stroke-width:1.8}
.card-foot{display:flex;align-items:center;justify-content:space-between;margin-top:11px;padding-top:10px;border-top:1px solid var(--border)}
.days{font-size:11px;color:var(--text-2)}
.days b{font-family:'JetBrains Mono',monospace;font-weight:600;color:var(--text)}
.mini-avatar{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:9px;font-weight:700;background:var(--surface-3);color:var(--text-2);border:1px solid var(--border)}
.add-card{
  width:100%;margin-top:8px;padding:8px;border:1px dashed var(--border-strong);
  border-radius:var(--r-sm);background:transparent;color:var(--text-3);
  font-size:11.5px;font-weight:500;display:flex;align-items:center;justify-content:center;gap:5px;
  transition:all .28s var(--spring);
}
.add-card:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft);transform:translateY(-2px)}
/* 缺陷/任务看板：列等高，添加入口固定在列底部，空数据时同样可见 */
.bug-board{align-items:stretch}
.bug-board .col{display:flex;flex-direction:column}
.bug-board .col .cards{flex:1}
.bug-board .col .add-card{flex:0 0 auto}
.empty{padding:26px 12px;text-align:center;color:var(--text-3);font-size:11.5px;border:1px dashed var(--border);border-radius:var(--r-md)}

/* Table */
.table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow);overflow:auto;max-height:520px}
table{border-collapse:collapse;width:100%;min-width:1080px;font-size:12px}
thead th{
  position:sticky;top:0;z-index:2;background:var(--surface-2);
  text-align:left;font-weight:600;font-size:11px;color:var(--text-3);
  letter-spacing:.02em;padding:11px 14px;border-bottom:1px solid var(--border);white-space:nowrap;
}
tbody td{padding:11px 14px;border-bottom:1px solid var(--border);color:var(--text-2);white-space:nowrap;max-width:260px;overflow:hidden;text-overflow:ellipsis}
tbody tr{cursor:pointer;transition:background .18s var(--ease)}
tbody tr:hover{background:var(--surface-2)}
tbody tr:last-child td{border-bottom:0}
.cell-name{font-weight:600;color:var(--text)}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;padding:2px 8px;border-radius:5px}
.pill.done{background:var(--emerald-soft);color:var(--emerald)}
.pill.talk{background:var(--amber-soft);color:var(--amber)}
.pill.stop{background:var(--rose-soft);color:var(--rose)}
.stage-chip{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;padding:2px 8px;border-radius:5px;white-space:nowrap}
.stage-chip i{width:5px;height:5px;border-radius:50%;background:currentColor}
.stage-chip.done{background:var(--emerald-soft);color:var(--emerald)}
.stage-chip.talk{background:var(--amber-soft);color:var(--amber)}
.stage-chip.stop{background:var(--rose-soft);color:var(--rose)}
.card-status{display:flex;align-items:center;gap:6px;margin:8px 0 6px;flex-wrap:wrap}
.dist-group{margin-bottom:16px}
.dist-group:last-child{margin-bottom:0}
.sub-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 12px;margin:8px 0 0 15px;padding-left:10px;border-left:1px solid var(--border)}
.sub-step{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:11px;color:var(--text-3);padding:1px 0}
.sub-step b{font-weight:600;color:var(--text-2)}
.num{font-family:'JetBrains Mono',monospace;font-variant-numeric:tabular-nums}
.yn{font-family:'JetBrains Mono',monospace;font-weight:600}
.yn.y{color:var(--emerald)}
.yn.n{color:var(--text-3)}

/* ============ Modal ============ */
.scrim{
  position:fixed;inset:0;z-index:50;background:var(--scrim);
  display:flex;align-items:flex-start;justify-content:center;
  padding:5vh 20px;overflow-y:auto;
  opacity:0;pointer-events:none;transition:opacity .14s ease-out;
  /* 不使用 backdrop-filter：全屏毛玻璃在弹窗开关时会触发整屏重绘，导致明显掉帧 */
}
.scrim.open{opacity:1;pointer-events:auto}
.modal{
  width:min(780px,100%);background:var(--surface);border:1px solid var(--border);
  border-radius:12px;box-shadow:var(--shadow-modal);
  transform:translateY(10px) scale(.99);transition:transform .16s ease-out;
}
.scrim.open .modal{transform:none}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 22px;border-bottom:1px solid var(--border)}
.modal-title{font-size:16px;font-weight:650;letter-spacing:-.015em}
.modal-sub{font-size:11.5px;color:var(--text-3);margin-top:4px}
.icon-btn{width:30px;height:30px;border-radius:var(--r-sm);border:1px solid var(--border);background:var(--surface);display:grid;place-items:center;color:var(--text-3);transition:all .25s var(--spring)}
.icon-btn:hover{color:var(--text);border-color:var(--border-strong);transform:translateY(-2px);box-shadow:var(--shadow)}
.icon-btn svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.8}
.modal-body{padding:20px 22px;max-height:64vh;overflow-y:auto}
.feishu-preview-body{padding:0;background:var(--surface);overflow:hidden}
.feishu-preview-body iframe{display:block;width:100%;height:64vh;border:0;background:#fff}
.form-section{margin-bottom:20px}
.form-section:last-child{margin-bottom:0}
.form-section-title{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--text-3);margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--border)}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px 16px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field.wide{grid-column:1/-1}
.field label{font-size:11.5px;font-weight:600;color:var(--text-2)}
.field input,.field select,.field textarea{
  width:100%;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface-2);padding:8px 10px;font-size:12.5px;outline:0;
  transition:border-color .2s var(--ease),box-shadow .2s var(--ease),background .2s var(--ease);
}
.field textarea{resize:vertical;min-height:62px}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring);background:var(--surface)}
.field input::placeholder,.field textarea::placeholder{color:var(--text-3)}
.static-field{min-height:34px;display:flex;align-items:center;padding:7px 10px;border:1px dashed var(--border);border-radius:var(--r-sm);background:var(--surface-2);color:var(--text-2);font-size:12.5px}
.file-upload input[type=file]{padding:7px 10px;cursor:pointer}
.upload-note{font-size:11px;line-height:1.5;color:var(--text-3)}
.upload-note b{color:var(--text-2);font-weight:600}
.upload-note.busy{color:var(--accent)}
.upload-note.done{color:var(--emerald)}
.upload-note.error{color:var(--rose)}
/* 责任人多选下拉 */
.owner-multi{position:relative}
.owner-multi input{cursor:pointer;padding-right:26px}
.owner-multi::after{content:'▾';position:absolute;right:9px;top:50%;transform:translateY(-50%);font-size:10px;color:var(--text-3);pointer-events:none}
.owner-pop{display:none;position:absolute;top:calc(100% + 3px);left:0;right:0;z-index:60;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);box-shadow:var(--shadow-hover);padding:8px;animation:pop .16s var(--spring)}
.owner-pop.open{display:block}
.owner-pop.up{top:auto;bottom:calc(100% + 3px)}
.op-list{max-height:176px;overflow-y:auto;display:flex;flex-direction:column;gap:1px}
.op-item{display:flex;align-items:center;gap:8px;padding:6px 5px;border-radius:4px;font-size:12px;color:var(--text-2);cursor:pointer;white-space:nowrap}
.op-item:hover{background:var(--surface-3)}
.op-item input{width:13px;height:13px;accent-color:var(--accent);flex:0 0 auto}
.op-empty{padding:12px 6px;font-size:11.5px;color:var(--text-3);text-align:center}
.modal-foot{display:flex;align-items:center;gap:10px;padding:16px 22px;border-top:1px solid var(--border)}
.modal-foot .spacer{flex:1}
/* 删除确认弹窗 */
.confirm-modal .modal-body{padding:22px 22px 24px}
.confirm-msg{font-size:13px;color:var(--text-2);line-height:1.65}
.toast{
  position:fixed;bottom:26px;right:26px;z-index:80;
  background:var(--text);color:var(--bg);border-radius:var(--r-md);
  padding:11px 16px;font-size:12.5px;font-weight:600;box-shadow:var(--shadow-hover);
  transform:translateY(16px);opacity:0;pointer-events:none;transition:all .38s var(--spring);
}
.toast.show{transform:none;opacity:1}

/* ============ Accounts & roles ============ */
.badge{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:600;padding:2px 8px;border-radius:5px;background:var(--surface-3);color:var(--text-2)}
.badge.admin{background:var(--accent-soft);color:var(--accent)}
.badge.editor{background:var(--amber-soft);color:var(--amber)}
.badge.viewer{background:var(--zinc-soft);color:var(--text-2)}
.badge.on{background:var(--emerald-soft);color:var(--emerald)}
.badge.off{background:var(--rose-soft);color:var(--rose)}
.read-only{display:none;align-items:center;gap:5px;font-size:11px;font-weight:600;padding:3px 9px;border-radius:99px;background:var(--zinc-soft);color:var(--text-2)}
.read-only svg{width:12px;height:12px;stroke:currentColor;stroke-width:1.8}
.user-row{position:relative;cursor:pointer;transition:background .18s var(--ease)}
.user-row:hover{background:var(--surface-2)}
.user-row .chev{width:13px;height:13px;stroke:var(--text-3);stroke-width:1.8;margin-left:auto}
.account-menu{
  position:fixed;right:16px;top:54px;width:330px;z-index:75;
  background:var(--surface);border:1px solid var(--border);border-radius:14px;
  -webkit-backdrop-filter:none;backdrop-filter:none;
  box-shadow:0 18px 50px rgba(0,0,0,.22),inset 0 1px 0 var(--glass-highlight);
  padding:18px 18px 8px;display:none;
}
.account-menu.open{display:block;animation:pop .22s var(--spring)}
@keyframes pop{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
.acct-head{padding-bottom:12px}
.acct-head-top{display:flex;align-items:center;gap:8px}
.acct-head-top b{font-size:15px;font-weight:650;color:var(--text)}
.acct-tag{font-size:10px;font-weight:600;color:var(--green,#10b981);background:rgba(16,185,129,.12);padding:2px 7px;border-radius:99px}
.acct-switch-btn{margin-left:auto;width:26px;height:26px;display:grid;place-items:center;border:1px solid var(--border);border-radius:7px;background:var(--surface-2);color:var(--text-3);cursor:pointer;transition:all .18s var(--ease)}
.acct-switch-btn:hover{color:var(--accent);border-color:var(--accent)}
.acct-switch-btn svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;fill:none}
.acct-id{font-size:11px;color:var(--text-3);margin-top:7px;font-family:'JetBrains Mono',monospace}
.acct-switch-box{border:1px solid var(--border);border-radius:10px;padding:5px;margin-bottom:10px;max-height:180px;overflow:auto;background:var(--surface-2)}
.acct-switch-opt{display:flex;align-items:center;gap:8px;width:100%;padding:7px 8px;border:0;border-radius:7px;background:transparent;text-align:left;cursor:pointer;font-family:inherit;transition:background .16s var(--ease)}
.acct-switch-opt:hover{background:var(--surface-3)}
.acct-switch-opt.current{background:var(--accent-soft)}
.acct-switch-opt .avatar{width:24px;height:24px;font-size:9px;flex:0 0 auto}
.acct-switch-opt .as-name{font-size:12px;font-weight:600;color:var(--text)}
.acct-switch-opt small{font-size:10px;color:var(--text-3);margin-left:auto}
.acct-switch-opt b{color:var(--accent);font-size:11px}
.acct-logout{padding:10px 0 4px;margin-top:4px;border-top:1px solid var(--border)}
.acct-logout button{display:flex;align-items:center;gap:9px;width:100%;padding:8px;border:0;border-radius:var(--r-sm);background:transparent;color:var(--text);font-size:12px;font-weight:500;text-align:left;cursor:pointer;font-family:inherit;transition:background .18s var(--ease)}
.acct-logout button:hover{background:var(--surface-2)}
.acct-logout button svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;fill:none}
@media (max-width:768px){.account-menu{right:8px;width:min(330px,calc(100vw - 16px))}}
.role-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.role-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:17px 18px;box-shadow:var(--shadow);transition:transform .38s var(--spring),box-shadow .38s var(--spring)}
.role-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-hover)}
.role-head{display:flex;align-items:center;gap:9px;margin-bottom:5px}
.role-icon{width:26px;height:26px;border-radius:var(--r-sm);display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}
.role-icon svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.8}
.role-name{font-size:13.5px;font-weight:650}
.role-meta{font-size:11px;color:var(--text-3);margin-bottom:14px}
.perm-list{display:flex;flex-direction:column;gap:2px;border-top:1px solid var(--border);padding-top:10px}
.perm-item{display:flex;align-items:center;gap:9px;padding:5px 2px;font-size:12px;color:var(--text-2);cursor:pointer;border-radius:var(--r-sm)}
.perm-item:hover{background:var(--surface-2)}
.perm-item input{width:14px;height:14px;accent-color:var(--accent);cursor:pointer;flex:0 0 auto}
.perm-item.locked{cursor:not-allowed;opacity:.62}
.perm-item .lock{margin-left:auto;font-size:10px;color:var(--text-3)}
.role-foot{display:flex;justify-content:space-between;align-items:center;margin-top:12px;padding-top:11px;border-top:1px solid var(--border);font-size:11px;color:var(--text-3)}
.link-btn{border:0;background:transparent;color:var(--accent);font-size:11.5px;font-weight:600;padding:2px 4px}
.link-btn:hover{text-decoration:underline}
.link-btn.danger{color:var(--rose)}
.action-cell{display:flex;gap:4px;white-space:nowrap}
.acct-cell{display:flex;align-items:center;gap:9px}
.acct-cell .avatar{width:26px;height:26px;font-size:10px}
.acct-cell b{color:var(--text);font-weight:600}
.hint-box{background:var(--accent-soft);border:1px solid var(--accent-ring);border-radius:var(--r-md);padding:11px 14px;font-size:12px;color:var(--text-2);margin-bottom:14px;line-height:1.6}
.hint-box b{color:var(--accent)}

/* ============ Unified project page ============ */
.filterbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.filterbar .spacer{flex:1}
/* 新建按钮统一置于筛选行末尾，与筛选控件同高 */
.filterbar > .btn.primary{flex:0 0 auto;height:32px}
.filter-select{
  height:32px;padding:0 28px 0 10px;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface);color:var(--text-2);font-size:12px;font-weight:500;
  outline:0;cursor:pointer;appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 9px center;
  transition:border-color .2s var(--ease),box-shadow .2s var(--ease),transform .28s var(--spring);
}
.filter-select:hover{border-color:var(--border-strong);color:var(--text);transform:translateY(-1px)}
.filter-select:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring)}
.filter-reset{height:32px;padding:0 10px;border:0;background:transparent;color:var(--text-3);font-size:11.5px;font-weight:500;display:inline-flex;align-items:center}
.filter-reset:hover{color:var(--accent)}
/* 筛选行所有控件统一 32px：视图切换容器原为 26+3*2+2=34px，与下拉/按钮不齐 */
.filterbar .view-switch{height:32px;padding:2px}
.filterbar .view-btn{height:26px}
.sort-toggle{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 11px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface);color:var(--text-2);font-size:11.5px;font-weight:600;cursor:pointer;transition:border-color .18s var(--ease),color .18s var(--ease)}
.sort-toggle:hover{border-color:var(--accent);color:var(--accent)}
.sort-toggle svg{width:13px;height:13px;flex:0 0 auto;transform:rotate(180deg);transition:transform .18s var(--ease)}
.sort-toggle.asc svg{transform:rotate(0)}
.sort-toggle .sort-arrow{font-size:13px;line-height:1;color:var(--accent)}
.th-sort{appearance:none;border:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;padding:0;display:inline-flex;align-items:center;gap:5px;cursor:pointer}
.th-sort:hover{color:var(--accent)}
.th-sort .sort-arrow{font-size:12px;line-height:1;color:var(--accent)}
.view-switch{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface)}
.view-btn{
  height:26px;padding:0 11px;border:0;border-radius:5px;background:transparent;color:var(--text-3);
  font-size:11.5px;font-weight:600;display:inline-flex;align-items:center;gap:6px;
  transition:all .26s var(--spring);
}
.view-btn svg{width:13px;height:13px;stroke:currentColor;stroke-width:1.8}
.view-btn:hover{color:var(--text);background:var(--surface-3)}
.view-btn.active{background:var(--accent-soft);color:var(--accent)}
.tag.batch-sub{background:var(--surface-3);color:var(--text-3)}
.tag.batch{font-family:'JetBrains Mono',monospace;letter-spacing:.01em}
.list-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:var(--shadow);overflow:hidden}
.list-panel .table-wrap{border:0;border-radius:0;box-shadow:none}

/* ============ Inline cell editing ============ */
td.editable{cursor:text;transition:background .18s var(--ease),box-shadow .18s var(--ease)}
td.editable:hover{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent-ring)}
td.editing{position:relative;overflow:visible;z-index:20;background:var(--surface)}
.cell-editor{
  width:100%;min-width:110px;height:28px;padding:0 8px;border:1px solid var(--accent);
  border-radius:5px;background:var(--surface);color:var(--text);font-size:12px;outline:0;
  box-shadow:0 0 0 3px var(--accent-ring);
}
.cell-editor.multi-trigger{text-align:left;display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:500}
.cell-editor.multi-trigger span{color:var(--text-3);font-size:10px}
.multi-pop{
  position:absolute;top:calc(100% + 3px);left:0;z-index:30;width:200px;

  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-md);
  box-shadow:var(--shadow-hover);padding:10px;animation:pop .2s var(--spring);
}
.multi-pop.up{top:auto;bottom:calc(100% + 3px)}
.mp-title{font-size:11px;font-weight:650;color:var(--text-2);margin-bottom:7px}
.mp-list{max-height:168px;overflow-y:auto;display:flex;flex-direction:column;gap:1px}
.mp-item{display:flex;align-items:center;gap:8px;padding:5px 4px;border-radius:4px;font-size:12px;color:var(--text-2);cursor:pointer;white-space:nowrap}
.mp-item:hover{background:var(--surface-3)}
.mp-item input{width:13px;height:13px;accent-color:var(--accent);flex:0 0 auto}
.mp-custom{display:flex;gap:5px;margin-top:8px;padding-top:8px;border-top:1px solid var(--border)}
.mp-custom input{width:100%;min-width:0;height:26px;padding:0 7px;border:1px solid var(--border);border-radius:4px;background:var(--surface-2);font-size:11.5px;outline:0}
.mp-custom input:focus{border-color:var(--accent)}
.mp-add{flex:0 0 auto;border:0;border-radius:4px;background:var(--accent-soft);color:var(--accent);font-size:11px;font-weight:600;padding:0 8px}
.mp-add:hover{background:var(--accent);color:#fff}
.mp-done{width:100%;height:27px;margin-top:8px;border:0;border-radius:5px;background:var(--accent);color:#fff;font-size:11.5px;font-weight:600}
.mp-done:hover{background:var(--accent-hover)}

/* ============ Bugs ============ */
.pill.bug-todo{background:var(--rose-soft);color:var(--rose)}
.pill.bug-doing{background:var(--amber-soft);color:var(--amber)}
.pill.bug-verify{background:var(--accent-soft);color:var(--accent)}
.pill.bug-done{background:var(--emerald-soft);color:var(--emerald)}
.sev{display:inline-flex;align-items:center;font-size:10.5px;font-weight:650;padding:2px 8px;border-radius:5px}
.sev.fatal{background:var(--rose-soft);color:var(--rose)}
.sev.major{background:var(--amber-soft);color:var(--amber)}
.sev.normal{background:var(--accent-soft);color:var(--accent)}
.sev.minor{background:var(--zinc-soft);color:var(--text-2)}
.bug-dist-grid{display:grid;grid-template-columns:1.15fr 1fr;gap:12px;margin-top:12px}
.bug-dist-grid .panel{box-shadow:var(--shadow)}
.bug-dist-grid .legend-item{margin-bottom:9px}

/* ============ People & group members ============ */
.person-link{display:flex;flex-direction:column;gap:1px;line-height:1.35}
.person-link b{font-size:12px;font-weight:600}
.person-link em{font-size:10px;color:var(--text-3);font-style:normal;letter-spacing:.02em}
td.pid{font-size:11px;color:var(--accent);font-weight:600;white-space:nowrap}

/* ============ Teams ============ */
.team-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.team-card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  padding:17px 18px;box-shadow:var(--shadow);
  transition:transform .38s var(--spring),box-shadow .38s var(--spring),border-color .25s var(--ease);
}
.team-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-hover);border-color:var(--border-strong)}
.team-head{display:flex;align-items:center;gap:11px;margin-bottom:13px}
.team-icon{width:32px;height:32px;border-radius:var(--r-md);display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}
.team-icon svg{width:17px;height:17px;stroke:currentColor;stroke-width:1.8}
.team-name{font-size:14px;font-weight:650;letter-spacing:-.01em}
.team-meta{font-size:11px;color:var(--text-3);margin-top:2px}
.team-actions{margin-left:auto;display:flex;gap:6px}
.team-link{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border-radius:var(--r-sm);background:var(--surface-2);font-size:11.5px;color:var(--text-2);margin-bottom:10px}
.team-link b{color:var(--accent);font-weight:700}
.team-projects{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:13px}
.mini-project{font-size:10.5px;padding:2px 7px;border-radius:5px;background:var(--surface-3);color:var(--text-2);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mini-project.more{background:var(--accent-soft);color:var(--accent)}
.team-sub{font-size:11px;font-weight:650;color:var(--text-3);margin-bottom:8px;display:flex;align-items:center;justify-content:space-between}
.team-card .table-wrap{border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden}
.team-card table{min-width:0;font-size:11.5px}
.team-card thead th{padding:8px 10px}
.team-card tbody td{padding:8px 10px;max-width:none}
.link-list{max-height:52vh;overflow-y:auto;display:flex;flex-direction:column;gap:2px}
.link-item{display:flex;align-items:center;gap:9px;padding:8px;border-radius:var(--r-sm);font-size:12px;color:var(--text-2);cursor:pointer}
.link-item:hover{background:var(--surface-3)}
.link-item input{width:14px;height:14px;accent-color:var(--accent)}
.link-item em{margin-left:auto;font-style:normal;font-size:10.5px;color:var(--text-3)}

/* ============ Pager ============ */
.pager{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:12px 4px 2px;flex-wrap:wrap}
.pg-total{font-size:11.5px;color:var(--text-3);white-space:nowrap}
.pg-total b{font-weight:650;color:var(--text-2)}
.pg-size{
  height:28px;padding:0 26px 0 9px;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface);color:var(--text-2);font-size:11.5px;font-weight:500;cursor:pointer;
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23888' stroke-width='1.3'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 7px center;
}
.pg-btns{display:flex;align-items:center;gap:5px}
.pg-arrow,.pg-num{
  min-width:28px;height:28px;padding:0 8px;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface);color:var(--text-2);font-size:11.5px;font-weight:500;
  transition:background .18s var(--ease),color .18s var(--ease),border-color .18s var(--ease);
}
.pg-arrow{font-size:16px;line-height:1;padding:0 7px}
.pg-arrow:hover:not(:disabled),.pg-num:hover:not(.active){border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.pg-arrow:disabled{opacity:.42;cursor:not-allowed}
.pg-num.active{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:650}
.pg-ellipsis{min-width:20px;text-align:center;color:var(--text-3);font-size:12px;user-select:none}
.pg-jump{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--text-3);white-space:nowrap}
.pg-jump-input{
  width:48px;height:28px;padding:0 6px;text-align:center;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface);color:var(--text-2);font-size:11.5px;font-weight:500;
}
.pg-jump-input:focus{outline:none;border-color:var(--accent);background:var(--surface)}
.pg-jump-input::-webkit-inner-spin-button,.pg-jump-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.pg-jump-input{-moz-appearance:textfield}
.board-toggle{
  width:100%;padding:8px;border:1px dashed var(--border);border-radius:var(--r-sm);
  background:transparent;color:var(--accent);font-size:11.5px;font-weight:600;
  transition:background .18s var(--ease),border-color .18s var(--ease);
}
.board-toggle:hover{background:var(--accent-soft);border-color:var(--accent)}
.bug-board{grid-template-columns:repeat(4,minmax(0,1fr))}
.bug-card .sev{font-size:10px}

/* ============ Responsive ============ */
@media (max-width:1024px){
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dist-grid{grid-template-columns:1fr}
  .bug-dist-grid{grid-template-columns:1fr}
  .role-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .team-grid{grid-template-columns:1fr}
  .content{padding:24px 22px 48px}
  .topbar{padding:0 22px}
}
@media (max-width:768px){
  .sidebar{padding:18px 8px 12px}
  .brand{padding:0 0 24px}
  .nav-groups{gap:10px}
  .nav-item svg{width:17px;height:17px}
  .content{padding:20px 14px 40px}
  .topbar{padding:0 14px}
  .search{width:150px}
  .search:focus-within{width:180px}
  .board,.bug-board{grid-template-columns:1fr}
  .role-grid{grid-template-columns:1fr}
  .account-menu{left:6px;bottom:62px;width:214px}
  .form-grid{grid-template-columns:1fr}
  .filterbar{gap:6px}
  .filterbar .spacer{display:none}
  .view-switch{margin-left:auto}
  .page-title{font-size:21px}
}

/* nav links */
a.nav-item{text-decoration:none;cursor:pointer}

/* ============ Embed mode (pages hosted in shell iframe) ============ */
html[data-embed="1"] .sidebar,html[data-embed="1"] .sidebar-pin{display:none}
html[data-embed="1"] .main,html[data-embed="1"].rail-pinned .main{margin-left:0}
html[data-embed="1"] .app{min-height:0;height:100vh}
/* 内嵌页顶部空白收起：顶栏信息由外壳页签栏承载，面包屑/只读标记隐藏；日期保留 */
html[data-embed="1"] .topbar{height:auto;flex:0 0 auto;min-height:0;overflow:hidden}
html[data-embed="1"] .topbar .crumb,
html[data-embed="1"] .topbar .read-only{display:none}
html[data-embed="1"] .content{padding-top:8px}
html[data-embed="1"] .toast{bottom:92px}

/* ============ AI assistant (shell entry) ============ */
.ai-fab{
  position:fixed;right:26px;bottom:26px;z-index:61;
  width:48px;height:48px;border:0;border-radius:15px;
  background:var(--accent);color:#fff;display:grid;place-items:center;
  box-shadow:0 8px 24px var(--accent-ring),0 2px 6px rgba(24,24,27,.12);
  transition:transform .35s var(--spring),background .2s var(--ease),box-shadow .2s var(--ease);
}
.ai-fab:hover{transform:translateY(-3px) scale(1.04);background:var(--accent-hover);box-shadow:0 12px 30px var(--accent-ring)}
.ai-fab svg{width:21px;height:21px}
.ai-fab .ai-fab-close{display:none}
body.ai-open .ai-fab .ai-fab-spark{display:none}
body.ai-open .ai-fab .ai-fab-close{display:block}

.ai-panel{
  position:fixed;right:26px;bottom:88px;z-index:60;
  width:360px;height:min(520px,calc(100vh - 130px));
  display:flex;flex-direction:column;overflow:hidden;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--shadow-modal);
  opacity:0;visibility:hidden;transform:translateY(12px) scale(.97);transform-origin:bottom right;
  transition:opacity .22s var(--ease),transform .35s var(--spring),visibility .22s var(--ease);
}
.ai-panel.open{opacity:1;visibility:visible;transform:none}
.ai-head{display:flex;align-items:center;gap:9px;padding:13px 14px;border-bottom:1px solid var(--border);background:var(--surface)}
.ai-head-icon{width:28px;height:28px;border-radius:8px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center}
.ai-head-icon svg{width:16px;height:16px;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ai-head-title{font-size:13px;font-weight:650;letter-spacing:-.01em}
.ai-status{font-size:10px;font-weight:600;color:var(--amber);background:var(--amber-soft);padding:2px 7px;border-radius:5px}
.ai-close{margin-left:auto;width:24px;height:24px;border:0;border-radius:var(--r-sm);background:transparent;color:var(--text-3);font-size:17px;line-height:1;display:grid;place-items:center}
.ai-close:hover{background:var(--surface-3);color:var(--text)}
.ai-body{flex:1;min-height:0;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;background:var(--bg)}
.ai-msg{display:flex}
.ai-msg.user{justify-content:flex-end}
.ai-bubble{max-width:86%;padding:9px 12px;border-radius:10px;font-size:12.5px;line-height:1.6;background:var(--surface-3);color:var(--text-2);white-space:pre-wrap;word-break:break-word}
.ai-msg.bot .ai-bubble{border-bottom-left-radius:3px}
.ai-msg.user .ai-bubble{background:var(--accent);color:#fff;border-bottom-right-radius:3px}
.ai-compose{display:flex;align-items:flex-end;gap:8px;padding:12px;border-top:1px solid var(--border);background:var(--surface)}
.ai-compose textarea{
  flex:1;min-width:0;resize:none;outline:none;max-height:96px;
  padding:9px 10px;border:1px solid var(--border);border-radius:var(--r-sm);
  background:var(--surface-2);font-size:12.5px;line-height:1.5;
  transition:border-color .18s var(--ease),box-shadow .18s var(--ease),background .18s var(--ease);
}
.ai-compose textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring);background:var(--surface)}
.ai-compose textarea::placeholder{color:var(--text-3)}
.ai-send{
  height:34px;flex:0 0 auto;padding:0 12px;border:0;border-radius:var(--r-sm);
  background:var(--accent);color:#fff;font-size:12px;font-weight:600;
  display:flex;align-items:center;gap:6px;transition:background .18s var(--ease);
}
.ai-send:hover{background:var(--accent-hover)}
.ai-send svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:768px){
  .ai-fab{right:16px;bottom:16px;width:44px;height:44px}
  .ai-panel{right:12px;left:12px;width:auto;bottom:72px;height:min(520px,calc(100vh - 96px))}
}

/* ============ Feishu doc link & converter ============ */
.doc-link{display:inline-flex;align-items:center;gap:4px;max-width:100%;color:var(--accent);text-decoration:none;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.doc-link:hover{text-decoration:underline}
.doc-link svg{width:12px;height:12px;stroke:currentColor;stroke-width:1.8}
.doc-link.muted{color:var(--text-3);font-weight:400;cursor:default}
.doc-link-sep{color:var(--text-3);margin:0 3px}

/* 关联文档：表单回显 + 选择弹窗 */
.doc-relay{display:flex;flex-wrap:wrap;gap:6px;min-height:34px;padding:7px 9px;border:1px solid var(--border);border-radius:6px;background:var(--surface-2)}
.doc-relay-empty{color:var(--text-3);font-size:11.5px;align-self:center}
.doc-relay-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:3px 5px 3px 8px;border:1px solid var(--border-strong);border-radius:5px;background:var(--surface);font-size:11.5px;color:var(--text)}
.doc-relay-open{color:var(--accent);font-size:12px;font-weight:700;text-decoration:none;line-height:1}
.doc-relay-open:hover{text-decoration:underline}
.doc-relay-del{width:15px;height:15px;display:grid;place-items:center;border:0;border-radius:3px;background:transparent;color:var(--text-3);cursor:pointer;font-size:13px;line-height:1}
.doc-relay-del:hover{background:var(--rose-soft);color:var(--rose)}
.doc-relay-actions{display:flex;align-items:center;gap:10px;margin-top:2px}
.doc-relay-tip{font-size:11px;color:var(--text-3)}
.doc-pick-list{margin-top:12px;border:1px solid var(--border);border-radius:var(--r-md);max-height:360px;overflow-y:auto}
.doc-pick-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid var(--border);cursor:pointer;transition:background .15s var(--ease)}
.doc-pick-item:last-child{border-bottom:0}
.doc-pick-item:hover{background:var(--surface-3)}
.doc-pick-item input{width:14px;height:14px;accent-color:var(--accent);flex:0 0 auto}
.doc-pick-main{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
.doc-pick-main b{font-size:12.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.doc-pick-sub{font-size:11px;color:var(--text-3);flex:0 0 auto}
.doc-pick-empty{padding:28px;text-align:center;color:var(--text-3);font-size:12px}
.doc-pick-count{font-size:11.5px;color:var(--text-3)}
.doc-pick-pager{padding:10px 2px 0;gap:8px}
.doc-pick-pager .pg-info,.doc-pick-pager .pg-btn,.doc-pick-pager .pg-num{font-size:11px}

/* 列表字段配置 */
th.col-settings{position:sticky;right:0;z-index:3;text-align:center;padding:8px 12px;border-left:1px solid var(--border)}
th.col-settings .col-settings-btn{
  width:26px;height:26px;display:grid;place-items:center;margin:0 auto;
  border:1px solid transparent;border-radius:var(--r-sm);background:transparent;color:var(--text-3);cursor:pointer;
  transition:background .16s var(--ease),color .16s var(--ease),border-color .16s var(--ease);
}
th.col-settings .col-settings-btn:hover{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}
th.col-settings .col-settings-btn svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round}
.col-config-list{border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden}
.col-config-item{
  display:flex;align-items:center;gap:12px;padding:9px 12px;border-bottom:1px solid var(--border);
  background:var(--surface);transition:background .15s var(--ease),opacity .15s var(--ease);
}
.col-config-item:last-child{border-bottom:0}
.col-config-item:hover{background:var(--surface-3)}
.col-config-item.hidden{opacity:.55}
.col-config-item.dragging{opacity:.4;background:var(--accent-soft)}
.col-config-item.drag-over{box-shadow:inset 0 2px 0 var(--accent)}
.col-grip{width:16px;height:16px;flex:0 0 auto;color:var(--text-3);cursor:grab;display:grid;place-items:center}
.col-grip:active{cursor:grabbing}
.col-grip svg{width:14px;height:14px;fill:currentColor;stroke:none}
.col-check{display:flex;align-items:center;gap:8px;flex:1;min-width:0;cursor:pointer;font-size:12.5px;color:var(--text)}
.col-check input{width:14px;height:14px;accent-color:var(--accent);flex:0 0 auto;cursor:pointer}
.col-check input:disabled{cursor:not-allowed}
.col-locked{font-size:10px;color:var(--accent);background:var(--accent-soft);padding:2px 7px;border-radius:4px;flex:0 0 auto}
.col-move{display:inline-flex;gap:4px;flex:0 0 auto}
.col-move button{
  width:24px;height:24px;display:grid;place-items:center;border:1px solid var(--border);
  border-radius:var(--r-sm);background:var(--surface);color:var(--text-3);cursor:pointer;font-size:12px;
  transition:background .15s var(--ease),color .15s var(--ease),border-color .15s var(--ease);
}
.col-move button:hover{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}

/* 自定义字段 */
.field label .req{color:var(--rose);margin-left:2px}
.field-manager{display:flex;flex-direction:column;gap:16px}
.fm-add{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px;border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface-2)}
.fm-add .field:nth-child(3){grid-column:1/-1}
.fm-required{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--text-2);align-self:end;height:34px;cursor:pointer}
.fm-required input{width:14px;height:14px;accent-color:var(--accent);cursor:pointer}
.fm-add>.btn{align-self:end}
.fm-list{display:flex;flex-direction:column;gap:10px}
.fm-item{padding:12px 14px;border:1px solid var(--border);border-radius:var(--r-md);background:var(--surface)}
.fm-item.locked{background:var(--surface-2);border-style:dashed}
.fm-row{display:grid;grid-template-columns:1fr 1fr 1fr 84px;gap:10px;align-items:end}
.fm-row .fm-required{height:34px}
.fm-actions{grid-column:1/-1;display:flex;align-items:center;gap:8px;justify-content:flex-end;padding-top:2px;border-top:1px solid var(--border)}
.fm-lock{font-size:11px;color:var(--text-3);padding:4px 8px;background:var(--surface-3);border-radius:4px}
.fm-item.locked input,.fm-item.locked select{opacity:.6;cursor:not-allowed}
.fm-empty{padding:22px;text-align:center;color:var(--text-3);font-size:12px;border:1px dashed var(--border);border-radius:var(--r-md)}
.fm-tip{font-size:11px;color:var(--amber)}
@media(max-width:640px){.fm-add,.fm-row{grid-template-columns:1fr}.fm-add .field:nth-child(3){grid-column:auto}}
.convert-modal{width:640px;max-width:calc(100vw - 32px)}
.convert-url{display:flex;gap:8px}
.convert-url input{flex:1;min-width:0}
.convert-editor{
  min-height:220px;max-height:46vh;overflow-y:auto;padding:12px 14px;outline:0;
  border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);
  font-size:13px;line-height:1.7;transition:border-color .18s var(--ease),box-shadow .18s var(--ease);
}
.convert-editor:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring);background:var(--surface)}
.convert-editor:empty:before{content:attr(data-placeholder);color:var(--text-3)}
.convert-editor img{max-width:100%}
.convert-actions{display:flex;justify-content:flex-end;margin-top:14px}
.convert-records{margin-top:18px;padding-top:12px;border-top:1px solid var(--border);display:flex;flex-direction:column;gap:6px}
.convert-records:empty{display:none}
.conv-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--r-sm);background:var(--surface-2);font-size:12px}
.conv-item b{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.conv-item time{color:var(--text-3);font-size:10.5px;font-family:'JetBrains Mono',monospace;white-space:nowrap}

/* ============ Glass surfaces ============
   参考 WeTab：柔和渐变背景 + 半透明磨砂卡片与表单。
   刻意不给 .scrim 加滤镜——全屏毛玻璃会在弹窗开关时整屏重绘。 */
/* 全局渐变背景：所有页面统一，可由自定义背景图覆盖（见下方 --page-bg-image） */
body{
  background:
    var(--page-bg-image, none),
    radial-gradient(900px 520px at 8% -12%,var(--glow-1),transparent 62%),
    radial-gradient(760px 500px at 96% 0%,var(--glow-2),transparent 58%),
    radial-gradient(680px 420px at 62% 100%,var(--glow-3),transparent 60%),
    var(--bg);
  background-size:var(--page-bg-size, cover);
  background-position:var(--page-bg-position, center);
  background-attachment:var(--page-bg-attach, fixed);
  background-repeat:no-repeat;
}
body.has-custom-bg .main{background:transparent}
:is(.panel,.card,.col,.table-wrap,.list-panel,.modal,.account-menu,.notif-panel,.ai-panel,
   .search,.icon-btn,.static-field,.field input,.field select,.field textarea,
   .filter-select,.view-switch,.scope-toggle,.board-toggle,.convert-editor,
   .conv-item,.fm-item input,.fm-item select,
   /* 全局扩展：统计块、看板列/卡片、表格头、进度面板、聊天气泡、标签等。
      注意：不给 .section/.toolbar 等大面积容器加 blur，避免整块重绘卡顿 */
   .stat,.board-col,.board-card,.issue-card,.team-card,
   .tabs,.empty-state,
   .modal-card,.drawer,.popover,.dropdown,.tooltip,.chip,.badge,
   .note,.announcement,.quote,.timeline-item,.comment,.activity-item){
  background:var(--glass-bg);
  border-color:var(--glass-border);
  -webkit-backdrop-filter:blur(var(--glass-blur)) saturate(135%);
  backdrop-filter:blur(var(--glass-blur)) saturate(135%);
  box-shadow:0 6px 22px rgba(24,24,40,.06),inset 0 1px 0 var(--glass-highlight);
}
:root[data-theme="dark"] :is(.panel,.card,.col,.table-wrap,.list-panel,.modal,.account-menu,.notif-panel,.ai-panel,
   .search,.icon-btn,.static-field,.field input,.field select,.field textarea,
   .filter-select,.view-switch,.scope-toggle,.board-toggle,.convert-editor,
   .conv-item,.fm-item input,.fm-item select,
   .stat,.board-col,.board-card,.issue-card,.team-card,
   .tabs,.empty-state,
   .modal-card,.drawer,.popover,.dropdown,.tooltip,.chip,.badge,
   .note,.announcement,.quote,.timeline-item,.comment,.activity-item){
  box-shadow:0 8px 26px rgba(0,0,0,.38),inset 0 1px 0 var(--glass-highlight);
}
/* 弹窗与通知/账号下拉统一为实色表面，避免透出下层页面内容 */
.modal{background:var(--surface);border-color:var(--border);-webkit-backdrop-filter:none;backdrop-filter:none}
:root[data-theme="dark"] .modal{background:var(--surface)}

/* ============ 顶栏工具区：铃铛消息 + 账号 ============ */
.topbar-util{margin-left:auto;display:flex;align-items:center;gap:8px;flex:0 0 auto}
.topbar-util .user-row{
  padding:3px 8px 3px 5px;border:1px solid var(--border);border-radius:9px;
  background:var(--surface-2);gap:8px;min-width:0;
}
.topbar-util .user-row:hover{background:var(--surface-3)}
.topbar-util .user-row .avatar{width:27px;height:27px;font-size:10px}
.topbar-util .user-row .user-name{font-size:12px;max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar-util .user-row .user-mail{font-size:10px;max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topbar-util .user-row .chev{width:12px;height:12px;margin-left:2px}
/* 外壳页签栏：账号区固定在右上角 */
.shell-main .topbar-util{
  position:absolute;top:0;right:14px;height:48px;z-index:6;
  margin-left:0;background:var(--surface-2);
}
.shell-main .topbar-util .user-row{border-color:transparent;background:transparent}
.shell-main .topbar-util .user-row:hover{background:var(--surface-3)}
.tabbar{padding-right:190px}
/* 全局搜索（顶栏工具区，铃铛左侧） */
.global-search{position:relative;display:flex;align-items:center;gap:7px;height:32px;width:250px;padding:0 9px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);color:var(--text-3);transition:border-color .18s var(--ease),box-shadow .18s var(--ease),width .25s var(--ease)}
.global-search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring);width:290px}
.global-search .gs-icon{width:15px;height:15px;stroke:currentColor;stroke-width:1.9;flex:0 0 auto}
.global-search input{border:0;background:transparent;outline:0;width:100%;min-width:0;font-size:12.5px;color:var(--text);font-family:inherit}
.global-search input::placeholder{color:var(--text-3)}
.global-search input::-webkit-search-cancel-button{display:none}
.gs-panel{
  position:absolute;top:calc(100% + 8px);right:0;width:400px;max-width:calc(100vw - 24px);z-index:80;
  max-height:min(520px,70vh);overflow:auto;display:none;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  -webkit-backdrop-filter:none;backdrop-filter:none;
  box-shadow:0 18px 50px rgba(0,0,0,.22),inset 0 1px 0 var(--glass-highlight);padding:6px;
}
.gs-panel.open{display:block;animation:pop .18s var(--ease)}
.gs-group{margin-bottom:4px}
.gs-group-title{padding:7px 9px 5px;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
.gs-group-title span{font-weight:600;opacity:.7}
.gs-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px 9px;border:0;border-radius:var(--r-sm);background:transparent;text-align:left;cursor:pointer;font-family:inherit;transition:background .14s var(--ease)}
.gs-item:hover,.gs-item.active{background:var(--accent-soft)}
.gs-ico{width:28px;height:28px;flex:0 0 auto;border-radius:8px;display:grid;place-items:center;background:var(--surface-3);color:var(--accent)}
.gs-ico svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round}
.gs-text{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}
.gs-text b{font-size:12.5px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gs-text small{font-size:10.5px;color:var(--text-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gs-empty{padding:30px 14px;text-align:center;color:var(--text-3);font-size:12px}
.gs-foot{padding:8px 9px 4px;border-top:1px solid var(--border);margin-top:4px;font-size:10px;color:var(--text-3);text-align:center}
@media (max-width:1100px){.global-search{width:190px}.global-search:focus-within{width:220px}}
.notif-bell{
  position:relative;width:32px;height:32px;flex:0 0 auto;display:grid;place-items:center;
  border:1px solid var(--border);border-radius:var(--r-sm);background:var(--surface-2);
  color:var(--text-2);cursor:pointer;transition:all .18s var(--ease);
}
.notif-bell:hover{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.notif-bell svg{width:16px;height:16px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round}
.notif-badge{
  position:absolute;top:-5px;right:-5px;min-width:16px;height:16px;padding:0 4px;
  border-radius:9px;background:var(--rose,#e11d48);color:#fff;font-size:10px;font-weight:700;
  display:none;align-items:center;justify-content:center;line-height:1;
  box-shadow:0 0 0 2px var(--surface);
}
.notif-badge.show{display:flex}
/* 消息通知下拉：与账号面板（.account-menu）统一视觉语言 */
.notif-panel{
  position:fixed;top:54px;right:16px;width:330px;max-width:calc(100vw - 24px);z-index:70;
  background:var(--surface);border:1px solid var(--border);border-radius:14px;
  -webkit-backdrop-filter:none;backdrop-filter:none;
  box-shadow:0 18px 50px rgba(0,0,0,.22),inset 0 1px 0 var(--glass-highlight);
  display:none;overflow:hidden;
}
.notif-panel.open{display:block;animation:pop .22s var(--spring)}
.notif-head{display:flex;align-items:center;gap:8px;padding:16px 18px 13px;border-bottom:1px solid var(--border)}
.notif-head b{font-size:15px;font-weight:650;color:var(--text)}
.notif-head .spacer{flex:1}
.notif-link{border:0;background:var(--accent-soft);color:var(--accent);font-size:11px;font-weight:600;cursor:pointer;padding:5px 10px;border-radius:99px;font-family:inherit;transition:all .18s var(--ease)}
.notif-link:hover{background:var(--accent);color:#fff}
.notif-link:disabled{opacity:.45;cursor:default}
.notif-link:disabled:hover{background:var(--accent-soft);color:var(--accent)}
.notif-list{max-height:420px;overflow:auto;padding:6px}
.notif-item{
  display:flex;align-items:flex-start;gap:11px;width:100%;padding:12px;border:0;
  border-radius:10px;background:transparent;text-align:left;cursor:pointer;
  font-family:inherit;transition:background .16s var(--ease);position:relative;
}
.notif-item:hover{background:var(--surface-2)}
.notif-item.unread{background:var(--accent-soft)}
.notif-ico{
  width:32px;height:32px;flex:0 0 auto;border-radius:9px;display:grid;place-items:center;
  background:var(--surface-3);color:var(--accent);
}
.notif-ico svg{width:16px;height:16px;stroke:currentColor;stroke-width:1.8;fill:none}
.notif-body{flex:1;min-width:0}
.notif-title{font-size:13px;font-weight:600;color:var(--text);line-height:1.35;display:flex;align-items:center;gap:6px;min-width:0}
.notif-title-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notif-dot{width:6px;height:6px;border-radius:50%;background:var(--rose,#e11d48);flex:0 0 auto}
.notif-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:7px}
.notif-type{flex:0 0 auto;font-size:10px;font-weight:600;line-height:1;color:var(--accent);background:var(--accent-soft);border-radius:99px;padding:4px 8px}
.notif-time{font-size:10px;color:var(--text-3);font-family:'JetBrains Mono',monospace;white-space:nowrap}
/* 缺省（空）状态：与账号面板一致的内边距节奏 */
.notif-empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:40px 18px 44px;text-align:center}
.notif-empty-ico{width:46px;height:46px;border-radius:13px;display:grid;place-items:center;background:var(--surface-2);color:var(--text-3)}
.notif-empty-ico svg{width:22px;height:22px;stroke:currentColor;stroke-width:1.6;fill:none;stroke-linecap:round;stroke-linejoin:round}
.notif-empty b{font-size:13px;font-weight:600;color:var(--text-2)}
@media (max-width:768px){
  .topbar-util .user-row .user-name,.topbar-util .user-row .user-mail{display:none}
  .tabbar{padding-right:110px}
  .notif-panel{right:8px;top:50px}
}

/* ============ 自定义背景可读性：加深文字、提高卡片不透明度 ============
   启用自定义背景后，背景图片会透过半透明卡片干扰文字；此处在浅/深主题下
   分别提高玻璃卡片的不透明度并加深次要文字，保证与背景的对比度。 */
body.has-custom-bg{
  --text-2:#3f3f46;
  --text-3:#71717a;
  --glass-bg:rgba(255,255,255,.92);
  --glass-bg-strong:rgba(255,255,255,.97);
  --glass-border:rgba(255,255,255,.9);
  --glass-highlight:rgba(255,255,255,.7);
}
:root[data-theme="dark"] body.has-custom-bg{
  --text-2:#d4d4d8;
  --text-3:#a1a1aa;
  --glass-bg:rgba(20,22,32,.92);
  --glass-bg-strong:rgba(24,26,38,.97);
  --glass-border:rgba(255,255,255,.14);
  --glass-highlight:rgba(255,255,255,.08);
}
/* 玻璃卡片类在自定义背景下统一提高实色比例（覆盖通用 62% 规则） */
body.has-custom-bg :is(.panel,.card,.col,.table-wrap,.list-panel,.stat,.board-col,.board-card,.issue-card,.team-card){
  background:var(--glass-bg);
}
body.has-custom-bg .stat-label,
body.has-custom-bg .dist-meta .left,
body.has-custom-bg .legend-item{color:var(--text-2)}
body.has-custom-bg .stat-foot,
body.has-custom-bg .stat-value small,
body.has-custom-bg .dist-meta .right,
body.has-custom-bg .sub-step,
body.has-custom-bg .sub-step b,
body.has-custom-bg .panel-title span{color:var(--text-2);font-weight:600}
body.has-custom-bg .sub-step{font-size:11.5px}
body.has-custom-bg .track,
body.has-custom-bg .quote-bar{background:color-mix(in srgb,var(--text-3) 22%,transparent)}
/* 分页栏已去除整行底板，纯文字部分直接落在背景图上：加深色值 + 柔和描边保证任意背景可读 */
body.has-custom-bg .pager .pg-total,
body.has-custom-bg .pager .pg-jump,
body.has-custom-bg .pager .pg-ellipsis{
  color:var(--text-2);
  text-shadow:0 1px 2px rgba(255,255,255,.55);
  font-weight:600;
}
:root[data-theme="dark"] body.has-custom-bg .pager .pg-total,
:root[data-theme="dark"] body.has-custom-bg .pager .pg-jump,
:root[data-theme="dark"] body.has-custom-bg .pager .pg-ellipsis{
  color:var(--text-1,#f4f4f5);
  text-shadow:0 1px 3px rgba(0,0,0,.9),0 0 2px rgba(0,0,0,.7);
}
/* 顶栏底板去除后，纯文字直接落在背景图上：加深色值 + 柔和描边保证可读 */
body.has-custom-bg .topbar .crumb,
body.has-custom-bg .topbar .read-only,
body.has-custom-bg .topbar .section-note{color:var(--text-2);text-shadow:0 1px 2px rgba(255,255,255,.55)}
:root[data-theme="dark"] body.has-custom-bg .topbar .crumb,
:root[data-theme="dark"] body.has-custom-bg .topbar .read-only,
:root[data-theme="dark"] body.has-custom-bg .topbar .section-note{color:var(--text-1,#f4f4f5);text-shadow:0 1px 3px rgba(0,0,0,.9),0 0 2px rgba(0,0,0,.7)}
/* 首页卡片使用独立变量，同步加深并提高实色 */
body.has-custom-bg[data-page="home"]{
  --home-card:rgba(255,255,255,.94);
  --home-card-hover:rgba(255,255,255,.98);
  --home-ink:#1c1e2e;
  --home-ink-2:#4b5068;
  --home-ink-3:#6f748c;
  --home-line:rgba(60,66,100,.14);
}
:root[data-theme="dark"] body.has-custom-bg[data-page="home"]{
  --home-card:rgba(22,24,34,.94);
  --home-card-hover:rgba(28,30,44,.98);
  --home-ink:#f2f3fa;
  --home-ink-2:#c2c5da;
  --home-ink-3:#9a9eb5;
  --home-line:rgba(180,185,220,.14);
}
