/* ============================================================
   国际商标报价系统 · 设计系统
   识别色:印章红(强调/盖章动作) + 墨蓝(结构) + 纸白(底)
   ============================================================ */
:root {
  /* 结构色 */
  --ink:        #1b2434;   /* 主文字 / 结构 */
  --ink-2:      #445064;   /* 次级文字 */
  --muted:      #8b93a2;   /* 辅助 / 占位 */
  /* 底与面 */
  --paper:      #eceef2;   /* 页面背景 */
  --surface:    #ffffff;   /* 卡片 */
  --surface-2:  #f6f7f9;   /* 内嵌区 */
  /* 线 */
  --line:       #e4e7ee;
  --line-2:     #d3d8e2;
  /* 印章红(唯一强调色) */
  --seal:       #c1352b;
  --seal-dark:  #9d2820;
  --seal-tint:  #fbecea;   /* 选中底 */
  --seal-line:  #e7b3ad;
  /* 语义 */
  --warn:       #b45309;
  --warn-tint:  #fdf6e3;
  --ok:         #15803d;

  /* 间距 */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px;
  /* 圆角 */
  --r:12px; --r-sm:8px; --pill:999px;
  /* 阴影 */
  --sh-1: 0 1px 2px rgba(27,36,52,.06), 0 1px 3px rgba(27,36,52,.04);
  --sh-2: 0 8px 30px rgba(27,36,52,.14);
  /* 字号 */
  --fs-xs:12px; --fs-sm:13px; --fs-md:14px; --fs-lg:16px; --fs-xl:20px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: var(--fs-md);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  padding-bottom: 88px;               /* 给底部动作条留位 */
}
a { color: var(--seal); text-decoration: none; }
a:hover { color: var(--seal-dark); }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; border-radius: 4px; }

/* ---------- 顶栏 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.seal-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--seal); color: #fff; font-size: 18px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.brand-name { font-size: var(--fs-lg); font-weight: 700; letter-spacing: .3px; }
.brand-sub  { font-size: var(--fs-xs); color: var(--muted); margin-top: -2px; }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 7px 14px; border-radius: var(--pill); color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 600;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--ink); color: #fff; }
/* 头像 */
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; vertical-align: middle; }
.nav .navuser { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; }
.nav .navuser:hover { background: var(--surface-2); }
.avatar-xl { width: 84px; height: 84px; font-size: 36px; border-radius: 50%; }
.avatar-edit { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch:hover, .swatch.on { border-color: var(--ink); }
.swatch.def { background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-size: 11px; }

/* ---------- 布局容器 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); padding: 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--seal); }
.card-head .hint { font-size: var(--fs-xs); color: var(--muted); }
.card h2 { font-size: var(--fs-lg); margin: 0; }

/* ---------- 表单 ---------- */
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
.field.grow { flex: 1; min-width: 220px; }
input[type=text], input[type=search], input[type=number], input[type=date], select {
  font: inherit; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
  height: 40px; line-height: 1.4;
}
input:focus, select:focus { border-color: var(--seal); box-shadow: 0 0 0 3px var(--seal-tint); outline: none; }
input::placeholder { color: var(--muted); }
#classCount { width: 90px; }
#quoteDate { width: 170px; }
#projectType { min-width:160px; }
.req-star { font-style:normal; color:var(--seal); margin-left:4px; font-size:11px; }
.radio-group { display:inline-flex; gap:0; align-items:center; }
.radio-chip { position:relative; padding:8px 16px; border:1px solid var(--line-2); font-size:var(--fs-md); cursor:pointer; color:var(--ink-2); background:var(--surface); height:40px; display:inline-flex; align-items:center; }
.radio-chip:first-child { border-radius:var(--r-sm) 0 0 var(--r-sm); }
.radio-chip:first-child { border-radius:var(--r-sm) 0 0 var(--r-sm); }
.radio-chip:last-child { border-radius:0 var(--r-sm) var(--r-sm) 0; margin-left:-1px; }
.radio-chip:first-child:has(+.radio-chip input:checked) { border-right-color:var(--ink); }
.radio-chip:hover { background:var(--surface-2); }
.radio-chip input { position:absolute; opacity:0; }
.radio-chip:has(input:checked) { background:var(--ink); color:#fff; border-color:var(--ink); font-weight:600; }
#quickCombos { margin-bottom:2px!important; }
#quickFavs { margin-bottom:0!important; }

/* ---------- 按钮 ---------- */
button { font: inherit; cursor: pointer; }
.btn, .primary, .gen, .close {
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 8px 16px; font-weight: 600; font-size: var(--fs-md);
  height: 40px; display:inline-flex; align-items:center;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.primary { background: var(--ink); color: #fff; }
.primary:hover { background: #0f1725; }
.primary.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.primary.ghost:hover { background: var(--surface-2); }
.gen { background: var(--seal); color: #fff; box-shadow: 0 2px 0 var(--seal-dark); }
.gen:hover { background: var(--seal-dark); }
.gen:active { transform: translateY(1px); box-shadow: none; }
.gen:disabled { opacity: .55; cursor: wait; box-shadow: none; }
.close { background: var(--seal); color: #fff; }
.close:hover { background: var(--seal-dark); }

/* ---------- 批量输入行 ---------- */
.pick-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pick-row input { flex: 1; min-width: 240px; }
.search-msg { font-size: var(--fs-sm); margin-top: 10px; line-height: 1.9; }
.search-msg:empty { display: none; }
.search-msg .ok { color: var(--ok); }
.search-msg .err { color: var(--seal); }
.search-msg .dim { color: var(--muted); }
.search-msg .amb { color: var(--warn); }
.search-msg .cand {
  padding: 3px 10px; margin: 2px; border: 1px solid var(--warn); border-radius: var(--pill);
  background: var(--surface); color: var(--warn); font-size: var(--fs-sm);
}
.search-msg .cand:hover { background: var(--warn); color: #fff; }

/* ---------- 快捷区(常用/组合) ---------- */
.quick { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.quick-title { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 700; min-width: 64px; }
.quick-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.qbtn { padding: 6px 13px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--surface); font-size: var(--fs-sm); color: var(--ink); height:32px; display:inline-flex; align-items:center; }
.qbtn:hover { border-color: var(--ink); }
.qbtn.combo { border-style: dashed; border-color: var(--seal-line); color: var(--seal); }
.qbtn.combo:hover { background: var(--seal-tint); }
.qbtn.on { background: var(--seal); color: #fff; border-color: var(--seal); }
.empty { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- 已选:带序号的报价行 ---------- */
.sel-head { display: flex; align-items: baseline; justify-content: space-between; }
.linelist { list-style: none; margin: 0; padding: 0; }
.linelist li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 4px; border-bottom: 1px solid var(--line);
}
.linelist li:last-child { border-bottom: none; }
.linelist .idx {
  flex: none; width: 24px; height: 24px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: var(--fs-xs); font-weight: 700; font-family: var(--mono);
  display: grid; place-items: center;
}
.linelist .name { font-weight: 600; }
.linelist .cont { font-size: var(--fs-xs); color: var(--muted); }
.linelist .grow { flex: 1; }
.linelist .rm { color: var(--muted); font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.linelist .rm:hover { color: var(--seal); background: var(--seal-tint); }
.sel-empty { color: var(--muted); padding: 16px 4px; text-align: center; }

/* ---------- 底部动作条 ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 14px 24px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(27,36,52,.06);
}
.actionbar .sum { font-size: var(--fs-sm); color: var(--ink-2); }
.actionbar .sum b { color: var(--seal); font-family: var(--mono); font-size: var(--fs-lg); }
.col-inp { width:70px; height:40px; padding:2px 4px; font-size:var(--fs-xs); text-align:center; border:1px solid var(--line); border-radius:4px; background:var(--surface); }
.col-inp:focus { border-color:var(--seal); outline:none; box-shadow:0 0 0 2px var(--seal-tint); }
.col-group { display: inline-flex; align-items: center; gap: 4px; }
.col-unit { font-size: var(--fs-xs); color: var(--muted); font-style: normal; white-space: nowrap; }
.price-tag { font-family: var(--mono); font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; min-width: 80px; text-align: right; }
.actionbar .gen { padding: 12px 28px; font-size: var(--fs-lg); }

/* ---------- 大洲标签 ---------- */
.chips { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.chip { padding: 6px 13px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--surface); font-size: var(--fs-sm); color: var(--ink-2); }
.chip:hover { border-color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(27,36,52,.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.mask.hidden { display: none; }
.modal { background: var(--surface); width: min(960px,96vw); max-height: 88vh; border-radius: var(--r); box-shadow: var(--sh-2); padding: 16px; display: flex; flex-direction: column; }
.modal-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.modal-head b { font-size: var(--fs-lg); white-space: nowrap; }
.modal-head input { flex: 1; }

/* ---------- 可勾选国家列表(弹窗内) ---------- */
.pick-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 8px; overflow: auto; }
.pick-list li { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); transition: border-color .12s, background .12s; }
.pick-list li:hover { border-color: var(--line-2); background: var(--surface-2); }
.pick-list li.on { border-color: var(--seal); background: var(--seal-tint); }
.pick-list label { display: flex; align-items: baseline; gap: 6px; cursor: pointer; }
.pick-list input[type=checkbox] { margin-top: 3px; accent-color: var(--seal); }
.pick-list b { font-weight: 600; }
.pick-list small { color: var(--muted); font-size: var(--fs-xs); }
.pick-list .warn { color: var(--warn); font-style: normal; font-size: var(--fs-xs); background: var(--warn-tint); padding: 0 6px; border-radius: 4px; }
.pick-list .order { margin-left: auto; color: var(--seal); font-weight: 700; font-family: var(--mono); }

/* ---------- 卡片(设置页) ---------- */
.card + .card { margin-top: 0; }
.hint { color: var(--muted); font-size: var(--fs-xs); margin: 4px 0 10px; }
.combo-new { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.combo-new input[type=text] { min-width: 180px; }
.combo-new input[type=search] { flex: 1; min-width: 220px; }
.card .pick-list { max-height: 320px; }
.combo-list { list-style: none; padding: 0; margin: 0; }
.combo-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.combo-list li:last-child { border-bottom: none; }
.combo-list b { color: var(--ink); }
.combo-list .del { color: var(--seal); margin-left: 10px; font-weight: 600; }
.msg { color: var(--ok); margin-left: 12px; font-size: var(--fs-sm); }
#comboSel { color: var(--ink-2); }

/* ---------- 表格(历史页) ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
td.num { font-family: var(--mono); }
.empty-state { text-align: center; color: var(--muted); padding: 40px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .wrap { padding: 14px; }
  .field.grow { min-width: 100%; }
  .actionbar { padding: 12px 16px; }
  .actionbar .gen { padding: 11px 20px; font-size: var(--fs-md); }
  .nav a { padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 登录页 ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #f2f4f8, #e6e9f0); padding: 20px; }
.login-card { background: var(--surface); width: min(380px, 94vw); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-2); padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { text-align: center; margin-bottom: 8px; }
.login-brand .brand-name { font-size: 22px; }
.seal-lg { width: 52px; height: 52px; font-size: 26px; border-radius: 12px; margin: 0 auto 4px; }
.login-card .field { width: 100%; text-align: left; align-items: flex-start; }
.login-card .field > span { font-size: var(--fs-sm); display: block; }
.remember-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; width: auto; }
.remember-label input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex-shrink: 0; }
.login-card input { width: 100%; padding: 11px 12px; box-sizing: border-box; }
.login-btn { width: 100%; margin-top: 6px; letter-spacing: 8px; text-align: center; justify-content: center; }
.login-err { color: var(--seal); font-size: var(--fs-sm); min-height: 18px; text-align: center; }
.remember-label { display:flex;align-items:center;gap:6px;font-size:var(--fs-sm);color:var(--ink-2);cursor:pointer; }

/* ---------- 开关切换 ---------- */
.toggle-chip { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; height: 40px; user-select: none; }
.toggle-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: relative; width: 44px; height: 24px; border-radius: 12px;
  background: var(--line-2); transition: background .2s;
}
.toggle-chip input:checked + .toggle-track { background: var(--seal); }
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #a0a8b4; box-shadow: 0 1px 2px rgba(0,0,0,.1);
  transition: transform .2s, background .2s, box-shadow .2s;
}
.toggle-chip input:checked + .toggle-track .toggle-knob {
  transform: translateX(20px);
  background: radial-gradient(circle at 30% 30%, #ff9a76, #e84a5f, #c1352b);
  box-shadow: 0 0 10px rgba(232,74,95,.5), 0 2px 4px rgba(193,53,43,.3);
}
.toggle-label-off, .toggle-label-on { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.toggle-label-on  { display: none; color: var(--seal); }
.toggle-chip input:checked ~ .toggle-label-off { display: none; }
.toggle-chip input:checked ~ .toggle-label-on  { display: inline; }

/* ---------- 分析页 ---------- */
.stats-row { display: flex; gap: 20px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 120px; text-align: center; padding: 12px; background: var(--surface-2); border-radius: var(--r-sm); }
.stat-num { font-size: 28px; font-weight: 800; color: var(--ink); font-family: var(--mono); }
.stat-label { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 10px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 14px; }
.bar { width: 100%; max-width: 36px; background: var(--seal); border-radius: 4px 4px 0 0; position: relative; transition: background .15s; }
.bar:hover { background: var(--seal-dark); }
.bar-val { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--ink-2); font-family: var(--mono); white-space: nowrap; }
.tip-host { position:relative; cursor:pointer; }
.tip-pop { display:none; position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%); background:#1b2434; color:#fff; padding:10px 14px; border-radius:8px; font-size:12px; line-height:1.7; white-space:nowrap; z-index:100; min-width:140px; pointer-events:none; }
.tip-host:hover .tip-pop { display:block; }
.tip-date { color:#8b93a2; font-size:11px; }
.tip-sum { color:#8b93a2; margin-bottom:4px; }
.tip-tbl { width:100%; border-collapse:collapse; font-size:12px; }
.tip-tbl td { padding:0 8px 0 0; }
.tip-tbl td:first-child { text-align:left; white-space:nowrap; }
.tip-tbl td:last-child { text-align:right; font-family:ui-monospace,"SF Mono",Menlo,monospace; white-space:nowrap; padding-right:0; }
.bar-label { font-size: 10px; color: var(--muted); margin-top: 4px; transform: rotate(-40deg); white-space: nowrap; }
.pct-bar { display: inline-block; width: 80px; height: 6px; background: var(--surface-2); border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.pct-fill { height: 6px; background: var(--seal); border-radius: 3px; }
.active-days { background:var(--ink); color:#fff; padding:2px 8px; border-radius:var(--pill); font-weight:700; text-decoration:none; }

