/* 确保 hidden 属性始终生效（.icon-btn/.user-chip 等显式 display 会覆盖 UA 的 hidden 规则） */
[hidden] { display: none !important; }

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1a2233;
  --text-soft: #6b7688;
  --line: #e6eaf2;
  --primary: #4f7cff;
  --primary-dark: #3a63e0;
  --primary-soft: #eef3ff;
  --danger: #ef4b4b;
  --success: #16a34a;
  --warn: #f59e0b;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(24, 39, 75, .06), 0 2px 8px rgba(24, 39, 75, .05);
  --shadow-md: 0 6px 24px rgba(24, 39, 75, .1);
  --shadow-lg: 0 18px 60px rgba(24, 39, 75, .18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------------- header ---------------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(120deg, #4f7cff 0%, #6a5cff 55%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 124, 255, .28);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { font-size: 26px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); display: flex; align-items: center; }
.brand-logo img { width: 30px; height: 30px; border-radius: 6px; display: block; }
.brand-text h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.brand-text p { margin: 1px 0 0; font-size: 12px; opacity: .82; }
.family-select { border: none; background: transparent; font-size: 17px; font-weight: 700; color: inherit; cursor: pointer; padding: 0 2px; letter-spacing: .3px; max-width: 140px; }
.family-select:focus { outline: none; box-shadow: 0 0 0 2px #4f7cff; border-radius: 4px; }
.family-select option { background: #fff; color: #333; font-weight: 400; font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.me-picker {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); border-radius: 999px; padding: 4px 6px 4px 12px;
}
.me-label { font-size: 12px; opacity: .9; }
.me-select {
  background: rgba(255,255,255,.9); color: #24304a; border: 0; border-radius: 999px;
  padding: 5px 10px; font-size: 13px; font-weight: 600; cursor: pointer; max-width: 120px;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; transition: .16s;
}
.icon-btn:hover { background: rgba(255,255,255,.3); }
.modal .icon-btn { background: #f1f3f8; color: var(--text-soft); }
.modal .icon-btn:hover { background: #e4e8f2; }

.main { padding-bottom: 96px; }

/* ---------------- stats ---------------- */
.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 14px 0 14px;
}
.stat {
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -14px; top: -14px; width: 54px; height: 54px;
  border-radius: 50%; background: var(--primary-soft); opacity: .8;
}
.stat b { display: block; font-size: 26px; line-height: 1.15; position: relative; }
.stat span { font-size: 12px; color: var(--text-soft); position: relative; }
.stat-sub { display: block; font-size: 11px; color: var(--text-soft); margin-top: 2px; font-style: normal; font-weight: 600; }
.stat.warn b { color: var(--warn); }
.stat.warn::after { background: #fff5e2; }
.stat.ok b { color: var(--success); }
.stat.ok::after { background: #e7f8ee; }
.stat.pri b { color: var(--primary); }

/* ---------------- quick add ---------------- */
/* 编辑弹窗内的智能识别区 */
.smart-input { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #edf1f9; }
.smart-input .paste-area { font-size: 13px; }
.smart-input .quick-add-tools { margin-top: 8px; }

.quick-add {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px; border: 1px solid var(--line);
}
.quick-add-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.quick-add-head h2 { margin: 0; font-size: 15px; }
.hint { font-size: 12px; color: var(--text-soft); }
kbd {
  background: #eef1f7; border: 1px solid #dde2ec; border-bottom-width: 2px;
  border-radius: 5px; padding: 0 5px; font-size: 11px; font-family: inherit;
}
.paste-area {
  width: 100%; border: 1.5px dashed #d5dcec; border-radius: 12px; padding: 12px 14px;
  resize: vertical; outline: none; background: #fbfcff; line-height: 1.6; transition: .16s;
}
.paste-area:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(79,124,255,.1); }
.quick-add-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: #c9d3e8; background: #f7f9ff; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-danger { color: var(--danger); border-color: #f6d6d6; }
.btn-danger:hover { background: #fff2f2; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

.ocr-progress { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-soft); }
.ocr-bar { flex: 1; height: 6px; background: #edf1f9; border-radius: 99px; overflow: hidden; }
.ocr-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4f7cff, #8b5cf6); transition: width .25s; }

/* ---------------- toolbar ---------------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; background: #eaeefa; padding: 4px; border-radius: 12px; gap: 2px; }
.tab {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 9px;
  cursor: pointer; font-size: 13px; color: var(--text-soft); font-weight: 500; transition: .16s;
}
.tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 600; }
.toolbar-right { display: flex; gap: 8px; margin-left: auto; }
.search {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px;
  width: 240px; outline: none; transition: .16s;
}
.search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,124,255,.1); }
.mini-select { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; }

/* ---------------- list ---------------- */
.group { margin-bottom: 20px; }
.group-head {
  display: flex; align-items: center; gap: 8px; margin: 0 2px 10px;
  font-size: 13px; color: var(--text-soft); font-weight: 600;
}
.group-head .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.group-head .count { background: #eaeefa; color: var(--primary); border-radius: 99px; padding: 1px 8px; font-size: 11px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 12px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 12px; box-shadow: var(--shadow-sm); position: relative;
  transition: .18s; display: flex; flex-direction: column; gap: 10px;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card.picked { opacity: .62; background: #fafbfd; }
.card.urgent::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--warn);
}
.card-top { display: flex; align-items: flex-start; gap: 12px; }
.code-box { min-width: 0; flex: 1; }
.code-label { font-size: 11px; color: var(--text-soft); letter-spacing: .5px; }
.code-value {
  font-size: 27px; font-weight: 800; letter-spacing: 1px; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: #16224a; word-break: break-all; cursor: pointer;
}
.card.picked .code-value { text-decoration: line-through; color: var(--text-soft); }
.code-value:hover { color: var(--primary); }
.owner-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 600; color: #fff;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap;
}
.station-line { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.station-line .ico { font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-item {
  font-size: 12px; color: var(--text-soft); background: #f4f6fb;
  border-radius: 7px; padding: 3px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meta-item.time-warn { background: #fff4e0; color: #b96e00; }
.meta-item.note { background: #f0edff; color: #6d54c4; }
.card-actions { display: flex; gap: 6px; border-top: 1px dashed var(--line); padding-top: 10px; }
.card-actions .grow { flex: 1; }

.empty { text-align: center; padding: 64px 20px; color: var(--text-soft); }
.empty .emo { font-size: 46px; display: block; margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.empty p { margin: 0; font-size: 13px; }

/* ---------------- fab ---------------- */
.fab {
  position: fixed; right: 24px; bottom: 24px; width: 54px; height: 54px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 28px; line-height: 1; color: #fff;
  background: linear-gradient(135deg, #4f7cff, #8b5cf6);
  box-shadow: 0 8px 26px rgba(79, 124, 255, .45); z-index: 40; transition: .18s;
}
.fab:hover { transform: scale(1.06) rotate(90deg); }

/* ---------------- modal ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(20, 27, 45, .5); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; background: #fff; border-radius: 18px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 88vh;
  animation: pop .18s ease-out;
}
.modal-lg { max-width: 820px; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.chip { background: var(--primary-soft); color: var(--primary); font-size: 12px; padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.modal-tip { padding: 10px 18px; font-size: 12px; color: var(--text-soft); background: #fafbff; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.grow { flex: 1; }
.req { color: var(--danger); }
.check-all { font-size: 13px; color: var(--text-soft); display: flex; align-items: center; gap: 6px; cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field > span { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.field input, .field select {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none;
  background: #fff; transition: .16s; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,124,255,.1); }
.field input.invalid { border-color: var(--danger); background: #fff7f7; }
.field-hint { font-size: 11px; color: var(--text-soft); margin-top: -1px; }

/* 类型 badge */
.type-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px; white-space: nowrap; flex-shrink: 0;
}
.type-badge.pickup { background: #eaf0ff; color: #2f4fc4; }
.type-badge.todo { background: #f0edff; color: #6d54c4; }

/* 备忘内容大字 */
.memo-value {
  font-size: 19px; font-weight: 700; line-height: 1.5;
  color: #16224a; letter-spacing: .2px; cursor: pointer;
  word-break: break-word; display: -webkit-box;
  -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.memo-value:hover { color: #6d54c4; }

/* 卡片标签行（与 code-box 分两行，避免挤窄内容） */
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 待还金额行 */
.debt-line { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.debt-amount { font-weight: 700; color: #7c3aed; font-size: 16px; }
.debt-inst { color: var(--text-soft); font-weight: 500; }

/* 待还类型 badge */
.type-badge.debt { background: #ede9fe; color: #7c3aed; }
.type-badge.private { background: #f3f4f6; color: #6b7280; font-size: 10px; }

/* 备忘卡片左侧色条 */
.card.memo-card::before { background: #8b5cf6; }
.card.memo-card.pending-card::before { background: #8b5cf6; }

/* 备忘类型切换 tab 组 */
#typeTabs { flex-shrink: 0; }
#tabs { flex-shrink: 0; }

/* 解析类型下拉（智能录入区） */
.parse-type-select {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 7px 10px; border-radius: 10px; cursor: pointer; font-size: 13px;
  outline: none; transition: .16s;
}
.parse-type-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,124,255,.1); }

/* 备忘类型的编辑表单提示 */
#editType { min-width: 140px; }

/* 设置 Tab */
.settings-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.settings-tab { padding: 10px 18px; font-size: 14px; border: none; background: transparent; color: var(--text-soft); cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; }
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.settings-panel { width: 100%; }

/* 系统设置 */
.settings-status { font-size: 12px; padding: 9px 12px; border-radius: 10px; margin-bottom: 14px; line-height: 1.5; }
.settings-status.ok { background: #eef7ee; color: #17803d; border: 1px solid #cdeccd; }
.settings-status.warn { background: #fff8ec; color: #9a6b00; border: 1px solid #f4e2bd; }
.settings-group { margin: 6px 0 4px; font-size: 14px; }
.settings-desc { font-size: 12px; color: var(--text-soft); margin: 0 0 12px; line-height: 1.5; }
.settings-test-to { flex: 1; min-width: 130px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; outline: none; background: #fff; }
.settings-test-to:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,124,255,.1); }
.settings-block { padding: 16px 0; border-top: 1px solid var(--line); }
.settings-block:first-of-type { border-top: none; padding-top: 4px; }
.settings-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }

/* AI 大模型配置 */
.ai-config { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 6px; }
.ai-config .field > span { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.ai-config .check-row { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.ai-config .check-row input { width: auto; }
.ai-config .ai-status { grid-column: 1 / -1; font-size: 12px; padding: 9px 12px; border-radius: 10px; min-height: 18px; }
.ai-config .ai-status.ok { background: #eef7ee; color: #17803d; border: 1px solid #cdeccd; }
.ai-config .ai-status.err { background: #fdeaea; color: #c22; border: 1px solid #f7cfcf; }
.ai-config .ai-status:not(.ok):not(.err) { color: var(--text-soft); }


/* review rows */
.rv-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; }
.rv-item.bad { border-color: #f7cfcf; background: #fffafa; }
.rv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rv-head label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; cursor: pointer; }
.rv-badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #eef7ee; color: #17803d; }
.rv-badge.mid { background: #fff4e0; color: #b96e00; }
.rv-badge.low { background: #fdeaea; color: #c22; }
.rv-warn { font-size: 11px; color: #c22; }
.rv-raw {
  margin-top: 8px; font-size: 11px; color: var(--text-soft); background: #f7f9fd;
  border-radius: 8px; padding: 7px 9px; white-space: pre-wrap; max-height: 74px; overflow: auto; line-height: 1.5;
}
.rv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.rv-grid .field-full { grid-column: 1 / -1; }

/* members */
.member-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.member-tag { display: flex; align-items: center; gap: 7px; background: #f4f6fb; border-radius: 99px; padding: 5px 8px 5px 12px; font-size: 13px; }
.member-tag i { width: 8px; height: 8px; border-radius: 50%; }
.member-tag button { border: 0; background: transparent; cursor: pointer; color: var(--text-soft); font-size: 13px; padding: 0 2px; }
.member-tag button:hover { color: var(--danger); }
.member-add { display: flex; gap: 8px; }
.member-add input { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none; }

/* drop overlay */
.drop-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  background: rgba(79, 124, 255, .12); backdrop-filter: blur(4px);
}
.drop-overlay.show { display: flex; }
.drop-inner {
  background: #fff; border: 2px dashed var(--primary); border-radius: 20px;
  padding: 40px 60px; text-align: center; box-shadow: var(--shadow-lg);
}
.drop-icon { font-size: 48px; }
.drop-title { font-size: 17px; font-weight: 700; margin-top: 10px; }
.drop-sub { font-size: 13px; color: var(--text-soft); margin-top: 4px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #1f2740; color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 13px; z-index: 300; box-shadow: var(--shadow-lg); max-width: 86vw;
  animation: toastIn .2s ease-out;
}
.toast[hidden] { display: none; }
.toast.err { background: #b3261e; }
.toast.ok { background: #16663f; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ------------------------------ 登录 / 注册 ------------------------------ */
.auth-screen {
  position: fixed; inset: 0; z-index: 500;
  display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #243056 0%, #0e1322 60%);
  padding: 20px;
}
.auth-screen.show { display: flex; }
.auth-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 22px; padding: 34px 30px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  text-align: center;
}
.auth-logo { font-size: 46px; line-height: 1; }
.auth-logo img { width: 72px; height: 72px; border-radius: 16px; display: block; margin: 0 auto; }
.auth-title { font-size: 21px; font-weight: 800; color: #1c2540; margin: 12px 0 6px; }
.auth-sub { font-size: 13px; color: #6b7280; margin: 0 0 18px; line-height: 1.5; }
.auth-error {
  background: #fdeceb; color: #b3261e; font-size: 13px;
  padding: 9px 12px; border-radius: 10px; margin-bottom: 14px; border: 1px solid #f5c2bd;
}
.auth-form { display: flex; flex-direction: column; gap: 11px; }
.auth-remember {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: #6b7280; text-align: left; cursor: pointer; user-select: none;
  margin: -3px 0 1px;
}
.auth-remember input { width: 15px; height: 15px; accent-color: #4f7cff; cursor: pointer; margin: 0; }
.auth-input {
  width: 100%; padding: 13px 14px; font-size: 15px;
  border: 1.5px solid #e4e7ee; border-radius: 12px; outline: none;
  transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.auth-input:focus { border-color: #4f7cff; box-shadow: 0 0 0 3px rgba(79,124,255,.15); }
.auth-submit {
  margin-top: 6px; padding: 13px; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #4f7cff, #6a5cff); border: none; border-radius: 12px;
  cursor: pointer; transition: transform .1s, box-shadow .15s;
}
.auth-submit:hover { box-shadow: 0 8px 20px rgba(79,124,255,.35); }
.auth-submit:active { transform: translateY(1px); }
.auth-toggle {
  margin-top: 16px; background: none; border: none; color: #4f7cff;
  font-size: 13px; cursor: pointer; font-weight: 600;
}
.auth-toggle:hover { text-decoration: underline; }
.auth-admin-link {
  display: block; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid #eef0f6; text-align: center;
  color: #6b7280; font-size: 12px; text-decoration: none;
}
.auth-admin-link:hover { color: #4f7cff; text-decoration: underline; }

/* 登录方式切换 tab */
.auth-tabs { display: flex; gap: 6px; background: #f1f3f9; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; padding: 9px 0; border: none; background: none; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: #6b7280; cursor: pointer; transition: all .15s;
}
.auth-tab.active { background: #fff; color: #1c2540; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.auth-reg { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }
.auth-hint { font-size: 12px; color: #8a93a6; margin: 14px 0 0; line-height: 1.5; text-align: center; }
.auth-input-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 2px; font-size: 16px; text-align: center; }

/* 修改密码验证方式 tab */
.pw-tabs { display: flex; gap: 6px; background: #f1f3f9; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.pw-tab {
  flex: 1; padding: 8px 0; border: none; background: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer; transition: all .15s;
}
.pw-tab.active { background: #fff; color: #1c2540; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.field-wrap { display: flex; flex-direction: column; gap: 10px; }
.pw-hint { font-size: 12px; color: var(--danger, #e53e3e); margin: 4px 0 0; }

/* 口令生成结果框 */
.passcode-box {
  margin-top: 16px; background: #f3f7ff; border: 1px dashed #4f7cff; border-radius: 14px; padding: 16px;
}
.passcode-title { font-size: 13px; color: #4f7cff; font-weight: 700; margin-bottom: 8px; }
.passcode-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 26px; font-weight: 800;
  letter-spacing: 4px; color: #1c2540; text-align: center; user-select: all; padding: 6px 0;
}
.passcode-actions { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; flex-wrap: wrap; }
.passcode-mail { font-size: 12px; color: #6b7280; }
.passcode-mail.ok { color: #16663f; }
.passcode-mail.err { color: #b3261e; }
.passcode-note { font-size: 12px; color: #6b7280; margin: 8px 0 0; line-height: 1.5; }

/* 成员列表中的邮箱与重发 */
.member-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #f1f3f9; font-size: 13px; }
.member-tag i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.member-tag b { font-weight: 600; }
.m-email { font-size: 12px; color: #6b7280; }
.m-resend { font-size: 12px; color: #4f7cff; background: none; border: 1px solid #c9d6ff; border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.m-resend:hover { background: #eaf0ff; }
.m-del { font-size: 12px; color: #b3261e; background: none; border: none; cursor: pointer; margin-left: 2px; }
.member-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.member-add input { flex: 1; min-width: 120px; }

/* 已登录用户标识 */
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: #e8ecf6; background: rgba(255,255,255,.08);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.user-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* webhook 自动化接入 */
.webhook-bar { display: flex; gap: 10px; margin-bottom: 12px; }
.webhook-bar .mini-input { flex: 1; min-width: 0; }
.webhook-list { display: flex; flex-direction: column; gap: 8px; }
.wh-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f5f7fb; border-radius: 10px; }
.wh-info { flex: 1; min-width: 0; }
.wh-name { font-size: 14px; font-weight: 600; color: #1a1f2e; margin-bottom: 4px; }
.wh-token { display: block; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #4f7cff; background: #eaf0ff; padding: 3px 8px; border-radius: 6px; cursor: pointer; word-break: break-all; max-width: 100%; }
.wh-token:hover { background: #d6e2ff; }
.wh-token-muted { color: #888; background: #f3f5fb; cursor: default; }
.wh-meta { font-size: 12px; color: #666; margin-top: 4px; }
.wh-row-family { background: #f8f9ff; border: 1px dashed #d0d4ff; padding: 10px 12px; border-radius: 8px; }
.wh-actions { display: flex; gap: 6px; flex-shrink: 0; }
.webhook-empty { color: #8a93a6; font-size: 13px; padding: 10px 0; }

/* CLI 接入 */
.cli-bar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cli-bar .mini-input { flex: 1; min-width: 0; }
.cli-bar .cli-perms { flex: 0 0 140px; }
.cli-bar .cli-days { flex: 0 0 120px; }
.cli-list { display: flex; flex-direction: column; gap: 8px; }
.cli-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: #f5f7fb; border-radius: 10px; }
.cli-row-family { background: #eaf7ee; border: 1px solid #b5e3c5; }
.cli-info { flex: 1; min-width: 0; }
.cli-name { font-size: 14px; font-weight: 600; color: #1a1f2e; margin-bottom: 4px; }
.cli-token { display: block; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #4f7cff; background: #eaf0ff; padding: 3px 8px; border-radius: 6px; cursor: pointer; word-break: break-all; max-width: 100%; }
.cli-token:hover { background: #d6e2ff; }
.cli-token-muted { color: #15803d; background: #dcfce7; cursor: default; }
.cli-token-muted:hover { background: #dcfce7; }
.cli-meta { font-size: 12px; color: #6b7280; margin-top: 4px; }
.cli-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.cli-empty { color: #8a93a6; font-size: 13px; padding: 10px 0; }
.cli-guide { margin-top: 10px; padding: 10px; background: #10141f; color: #e8ecf6; border-radius: 10px; }
.cli-guide-title { font-size: 12px; color: #9fb0d8; margin-bottom: 6px; }
.cli-guide-pre { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #f7f8fc; }
.cli-guide-actions { margin-top: 8px; }

/* 分享给家人按钮（并入家庭成员弹窗） */
.share-row { display: flex; justify-content: center; margin: 12px 0 4px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* responsive */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .rv-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .header-inner { height: 56px; }
  .brand-text h1 { font-size: 15px; }
  .me-picker { padding: 3px 4px 3px 9px; }
  .me-label { display: none; }
  .cards { grid-template-columns: 1fr; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .search { flex: 1; width: auto; }
  .form-grid, .rv-grid { grid-template-columns: 1fr; }
  .modal { padding: 10px; }
  .fab { right: 16px; bottom: 16px; }
}

/* ---------------- more menu (⋯ dropdown) ---------------- */
.more-menu { position: relative; }
.more-dropdown {
  position: absolute; top: 42px; right: 0; z-index: 60;
  background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.18);
  min-width: 180px; padding: 6px 0; overflow: hidden;
}
.more-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 16px; border: 0; background: none;
  font-size: 14px; color: var(--text); cursor: pointer; text-align: left;
  transition: background .12s;
}
.more-item:hover { background: var(--primary-soft); color: var(--primary); }

/* ---------------- 重要性 / 紧迫性标记 ---------------- */
.imp-badge { font-weight: 600; }
.imp-high { background: #ffe5e5; color: #d32f2f; }
.imp-medium { background: #fff4d6; color: #b8860b; }
.imp-low { background: #eceff1; color: #78909c; }
.urg-badge { font-weight: 600; }
.urg-urgent { background: #fff0e0; color: #e65100; }
.urg-normal { background: #e8f5e9; color: #388e3c; }

/* ---------------- 四象限视图 ---------------- */
.quadrants {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.quadrant {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  min-height: 140px;
}
.quadrant.q1 { border-top: 3px solid #d32f2f; }
.quadrant.q2 { border-top: 3px solid #f9a825; }
.quadrant.q3 { border-top: 3px solid #1e88e5; }
.quadrant.q4 { border-top: 3px solid #9e9e9e; background: #fafafa; }
.quadrant-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.quadrant-icon { font-size: 18px; }
.quadrant-title { font-weight: 700; font-size: 14px; }
.quadrant-hint { font-size: 11px; color: var(--text-soft); flex: 1; }
.quadrant-count {
  background: #eaeefa; color: var(--primary);
  border-radius: 99px; padding: 2px 10px;
  font-size: 12px; font-weight: 600;
}
.quadrant-empty {
  text-align: center; color: var(--text-soft);
  padding: 20px; font-size: 13px;
}
.quadrant .cards { grid-template-columns: 1fr; }
.quadrant .card { box-shadow: none; }

/* ---------------- 视图切换标签 ---------------- */
.view-label {
  font-size: 12px; color: var(--text-soft);
  font-weight: 500; margin-right: 4px;
  align-self: center;
  white-space: nowrap;
}

/* ---------------- 工具栏第二行：筛选控件 ---------------- */
.toolbar-filters {
  margin-top: 8px;
  margin-bottom: 14px;
}
.toolbar-filters .search { flex: 1; max-width: 260px; }
.toolbar-filters .mini-select { flex: 0 0 auto; }

@media (max-width: 640px) {
  .toolbar { flex-wrap: wrap; gap: 6px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tabs .tab { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .toolbar-right { flex-wrap: wrap; gap: 4px; }
  .view-label { display: none; }
  .toolbar-filters { flex-wrap: wrap; gap: 6px; }
  .toolbar-filters .search { max-width: none; flex: 1 1 100%; }
  .quadrants { grid-template-columns: 1fr; }
}

/* ---------------- 概览四象限预览 ---------------- */
.quad-preview {
  grid-column: 1 / -1;
  margin-top: 2px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.quad-preview-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 10px; display: block;
}
.quad-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.quad-box {
  border-radius: 10px; padding: 12px 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: transform 0.1s, box-shadow 0.15s;
}
.quad-box:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.quad-num { font-size: 22px; font-weight: 800; }
.quad-label { font-size: 12px; }
.quad-box.q1 { background: #fee2e2; }
.quad-box.q1 .quad-num { color: #dc2626; }
.quad-box.q1 .quad-label { color: #991b1b; }
.quad-box.q2 { background: #fef3c7; }
.quad-box.q2 .quad-num { color: #d97706; }
.quad-box.q2 .quad-label { color: #92400e; }
.quad-box.q3 { background: #e0e7ff; }
.quad-box.q3 .quad-num { color: #4f46e5; }
.quad-box.q3 .quad-label { color: #3730a3; }
.quad-box.q4 { background: #e2e8f0; }
.quad-box.q4 .quad-num { color: #475569; }
.quad-box.q4 .quad-label { color: #475569; }

/* ---------------- 单象限钻取视图 ---------------- */
.focus-back {
  padding: 8px 0 14px; font-size: 14px; color: var(--primary);
  cursor: pointer; font-weight: 500;
}
.focus-header {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.focus-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.focus-icon { font-size: 24px; }
.focus-title { flex: 1; font-size: 18px; font-weight: 700; color: var(--text); }
.focus-count { font-size: 28px; font-weight: 800; }
.focus-hint { font-size: 12px; color: var(--text-soft); }
.focus-header.q1 .focus-count { color: #dc2626; }
.focus-header.q2 .focus-count { color: #d97706; }
.focus-header.q3 .focus-count { color: #4f46e5; }
.focus-header.q4 .focus-count { color: #475569; }

/* ---------------- tag / occ badges ---------------- */
.tag-badge {
  display: inline-block; padding: 2px 8px; border-radius: 7px;
  font-size: 11px; font-weight: 600; background: #e8f4fd; color: #0288d1;
}
.occ-badge {
  display: inline-block; padding: 2px 8px; border-radius: 7px;
  font-size: 11px; font-weight: 700; background: #fce4ec; color: #c62828;
}

/* ---------------- 四象限头部可点击 ---------------- */
.quadrant-head[data-quad] { cursor: pointer; }
.quadrant-head[data-quad]:hover { background: rgba(0,0,0,0.02); border-radius: 8px; }

@media (max-width: 640px) {
  .quad-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------------- 页脚备案信息 ---------------- */
.site-footer {
  background: #f4f6fa; border-top: 1px solid var(--line);
  padding: 14px 16px 18px; margin-top: 32px;
  text-align: center;
}
.footer-inner { max-width: 1080px; margin: 0 auto; }
.footer-brand {
  font-size: 12px; color: var(--text-soft); margin-bottom: 6px;
}
.footer-icp {
  font-size: 11px; color: var(--text-soft);
}
.footer-icp a {
  color: #5a6b8a; text-decoration: none;
}
.footer-icp a:hover { color: var(--primary); text-decoration: underline; }
.footer-sep {
  display: inline-block; margin: 0 8px; color: #ccc;
}
