/* 新外观 (2026-11-05)：用户觉得系统“像一几年的产物，不够优美、智能”。
   本文件放在所有页面样式之后，只改外观（颜色、字体、圆角、阴影、间距），不改任何流程。
   一种主色（靛蓝），柔和阴影代替彩色描边，统一输入框与按钮，顶部加品牌标志、搜索和当前账号。 */

:root {
  --ui-brand: #4f46e5;
  --ui-brand-strong: #4338ca;
  --ui-brand-soft: #eef0ff;
  --ui-brand-ring: rgb(79 70 229 / 18%);
  --ui-ink: #0f172a;
  --ui-ink-2: #334155;
  --ui-muted: #64748b;
  --ui-faint: #94a3b8;
  --ui-bg: #f4f5f9;
  --ui-surface: #fff;
  --ui-line: #e6e8ef;
  --ui-line-strong: #d4d8e2;
  --ui-success: #059669;
  --ui-success-soft: #ecfdf5;
  --ui-warn: #d97706;
  --ui-warn-soft: #fff8eb;
  --ui-danger: #dc2626;
  --ui-danger-soft: #fef2f2;
  --ui-radius: 16px;
  --ui-radius-sm: 10px;
  --ui-shadow: 0 1px 2px rgb(16 24 40 / 4%), 0 3px 12px -4px rgb(16 24 40 / 6%);
  --ui-shadow-hover: 0 2px 4px rgb(16 24 40 / 5%), 0 12px 28px -10px rgb(16 24 40 / 16%);
  --ui-shadow-lg: 0 16px 40px -12px rgb(16 24 40 / 22%);
  --workspace-ink: var(--ui-ink);
  --workspace-muted: var(--ui-muted);
  --workspace-line: var(--ui-line);
  --workspace-accent: var(--ui-brand);
  color: var(--ui-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 420px at 12% -120px, rgb(99 102 241 / 7%), transparent 70%),
    radial-gradient(900px 380px at 100% -160px, rgb(139 92 246 / 6%), transparent 70%),
    var(--ui-bg);
  background-attachment: fixed;
  color: var(--ui-ink);
}
::selection { background: rgb(79 70 229 / 18%); }
a { color: var(--ui-brand); }
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--ui-brand); outline-offset: 2px; }
.skip-link { color: var(--ui-brand); }

/* ---------- 顶部：品牌、搜索、当前账号 ---------- */
.site-header {
  background: rgb(255 255 255 / 82%);
  border-bottom: 0;
  gap: 1rem;
  margin: 0;
  max-width: none;
  min-height: 3.75rem;
  padding: .6rem max(1rem, calc((100% - 1280px) / 2 + 1.5rem));
}
.brand { align-items: center; color: var(--ui-ink); display: inline-flex; flex: 0 0 auto; font-size: 1rem; font-weight: 700; gap: .6rem; letter-spacing: .01em; }
.brand-mark {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 10px;
  box-shadow: 0 4px 12px -2px rgb(99 102 241 / 45%), inset 0 1px 0 rgb(255 255 255 / 25%);
  color: #fff;
  display: inline-grid;
  height: 2rem;
  place-items: center;
  width: 2rem;
}
.brand-mark svg { height: 1.15rem; width: 1.15rem; }
.header-search {
  align-items: center;
  background: #f1f3f8;
  border: 1px solid transparent;
  border-radius: 999px;
  display: flex;
  flex: 0 1 22rem;
  gap: .45rem;
  margin-left: auto;
  padding: 0 .4rem 0 .85rem;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.header-search:focus-within { background: #fff; border-color: var(--ui-brand); box-shadow: 0 0 0 4px var(--ui-brand-ring); }
.header-search .nav-icon { color: var(--ui-faint); flex: 0 0 auto; }
.header-search input[type="search"] {
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: .875rem;
  min-height: 2.35rem;
  min-width: 0;
  outline: 0;
  padding: 0;
  width: 100%;
}
.header-search input[type="search"]:focus { box-shadow: none; }
.header-search kbd {
  background: #fff;
  border: 1px solid var(--ui-line-strong);
  border-radius: 6px;
  color: var(--ui-faint);
  font: 600 .7rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: .2rem .4rem;
}
.header-search:focus-within kbd { display: none; }
.header-tools { align-items: center; display: flex; gap: .75rem; margin-left: auto; }
.header-search + .header-tools { margin-left: 0; }
.header-link { color: var(--ui-muted); font-size: .85rem; font-weight: 500; }
.header-link:hover { color: var(--ui-brand); }
.header-user { align-items: center; display: inline-flex; gap: .55rem; min-width: 0; }
.header-avatar {
  background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  border-radius: 999px;
  color: var(--ui-brand-strong);
  display: inline-grid;
  flex: 0 0 auto;
  font-size: .85rem;
  font-weight: 700;
  height: 2.1rem;
  place-items: center;
  width: 2.1rem;
}
.header-user-text { display: grid; line-height: 1.2; min-width: 0; }
.header-user-text b { font-size: .85rem; font-weight: 600; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user-text small { color: var(--ui-muted); font-size: .72rem; }
.header-logout {
  background: transparent;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  box-shadow: none;
  color: var(--ui-ink-2);
  font-size: .8rem;
  font-weight: 500;
  min-height: 2rem;
  padding: .3rem .8rem;
}
.header-logout:hover { background: #f1f3f8; color: var(--ui-ink); }

/* ---------- 主导航：图标 + 胶囊高亮 ---------- */
.role-main-nav {
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: rgb(255 255 255 / 80%);
  border-bottom: 1px solid var(--ui-line);
  border-top: 0;
  box-shadow: 0 1px 0 rgb(255 255 255 / 60%) inset;
}
.role-main-nav-items { gap: .15rem; padding-block: .4rem; }
.role-main-nav-items > a {
  border: 0;
  border-radius: 9px;
  color: var(--ui-ink-2);
  font-size: .875rem;
  font-weight: 500;
  gap: .4rem;
  padding: .45rem .7rem;
  transition: background .15s, color .15s;
}
.role-main-nav-items > a:hover { background: #f1f3f8; color: var(--ui-ink); }
.role-main-nav-items > a.is-current { background: var(--ui-brand-soft); color: var(--ui-brand); font-weight: 600; }
.nav-icon { flex: 0 0 auto; height: 1rem; width: 1rem; }
.role-main-nav-items > a .nav-icon { opacity: .75; }
.role-main-nav-items > a.is-current .nav-icon { opacity: 1; }

/* ---------- 页面标题与问候 ---------- */
.page-content { padding-top: 1.5rem; }
.page-greeting {
  align-items: baseline;
  animation: ui-rise .45s ease-out both;
  color: var(--ui-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: .9rem;
  gap: .35rem .75rem;
  margin: 0 0 .35rem;
}
.page-greeting b {
  background: linear-gradient(90deg, #4f46e5, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1rem;
  font-weight: 650;
}
h1, h2, h3 { color: var(--ui-ink); }
.workspace-heading h1, .page-content > h1 { font-size: clamp(1.4rem, 2.1vw, 1.8rem); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.section-heading h2, .sales-performance-heading h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: 0; }
.eyebrow { color: var(--ui-muted); font-size: .78rem; font-weight: 500; letter-spacing: .01em; }
.muted, .form-hint { color: var(--ui-muted); }

/* ---------- 卡片 ---------- */
.content-card, .metric-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
}
@media (min-width: 768px) { .content-card { padding: 1.4rem 1.5rem; } }
.workspace-collapsible { padding: 0; }
.workspace-collapsible > summary b, .workspace-collapsible > summary > b { color: var(--ui-brand); font-weight: 600; }
.empty-state { color: var(--ui-faint); }

/* 浅色数字卡：去掉彩色描边，改成柔和底色 + 左上角色点 */
.sales-metric-card, .role-priority-card, .sales-status-summary article {
  border-color: transparent;
  border-radius: 14px;
  box-shadow: none;
  position: relative;
}
.sales-metric-card { background: #f6f7fb; }
.sales-metric-success { background: var(--ui-success-soft); }
.sales-metric-warning { background: var(--ui-warn-soft); }
.sales-metric-card strong, .role-priority-card strong { font-weight: 700; letter-spacing: -.01em; }
.sales-metric-card span, .role-priority-card span { font-weight: 600; }
.role-priority-card { background: #fff; border: 1px solid var(--ui-line); transition: box-shadow .15s, transform .15s; }
a.role-priority-card:hover { box-shadow: var(--ui-shadow-hover); transform: translateY(-1px); }
.role-priority-card.primary { background: var(--ui-brand-soft); border-color: transparent; }
.sales-task-card { border-color: var(--ui-line); border-radius: 14px; transition: box-shadow .15s, transform .15s, border-color .15s; }
.sales-task-card:hover { border-color: #c7cbff; box-shadow: var(--ui-shadow-hover); }
.sales-task-icon { background: var(--ui-brand-soft); border-radius: 12px; color: var(--ui-brand); }
.employee-avatar { background: var(--ui-brand-soft); color: var(--ui-brand-strong); }
.progress-track { background: #eceef5; border-radius: 999px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 999px; }

/* ---------- 按钮 ---------- */
button, .button-link {
  background: var(--ui-brand);
  border-radius: var(--ui-radius-sm);
  font-weight: 600;
  transition: background .15s, box-shadow .15s, transform .06s, border-color .15s, color .15s;
}
button:not([class]), .button-link {
  box-shadow: 0 1px 2px rgb(67 56 202 / 28%), inset 0 1px 0 rgb(255 255 255 / 14%);
}
button:not([class]):hover, .button-link:hover { background: var(--ui-brand-strong); }
button:not([class]):active, .button-link:active { transform: translateY(1px); }
/* 蓝底按钮的字一律白色：库存页“＋ 新增具体商品”原来被区块链接颜色盖成蓝字蓝底，看不见 */
a.button-link:not(.secondary-button), a.button-link:not(.secondary-button):hover { color: #fff; }
/* 白底的次要按钮（如补货页“已在补货”那一行）保持深色字：上一条曾把它们也改成白字看不见（2026-11-06） */
a.button-link.secondary-button, a.button-link.secondary-button:hover { color: var(--ui-ink-2); }
.inventory-all-product-actions a.button-link { font-size: .8rem; padding: .4rem .8rem; }
.secondary-button, button.secondary-button {
  background: #fff;
  border: 1px solid var(--ui-line-strong);
  box-shadow: 0 1px 2px rgb(16 24 40 / 5%);
  color: var(--ui-ink-2);
}
.secondary-button:hover { background: #f6f7fb; border-color: #c3c8d4; color: var(--ui-ink); }
.danger-button { background: var(--ui-danger-soft); border: 1px solid #fecaca; box-shadow: none; color: #b91c1c; }
.danger-button:hover { background: #fee2e2; }
.copy-button { background: var(--ui-brand-soft); border-color: #dfe2ff; box-shadow: none; color: var(--ui-brand); }

/* ---------- 输入框 ---------- */
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"])),
select,
textarea {
  background-color: #fff;
  border: 1px solid var(--ui-line-strong);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-ink);
  transition: border-color .15s, box-shadow .15s;
}
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"])):hover,
select:hover,
textarea:hover { border-color: #bcc2cf; }
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"])):focus,
select:focus,
textarea:focus { border-color: var(--ui-brand); box-shadow: 0 0 0 4px var(--ui-brand-ring); outline: none; }
::placeholder { color: var(--ui-faint); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ui-brand); }
input[type="file"]::file-selector-button { background: var(--ui-brand-soft); border: 0; border-radius: 8px; color: var(--ui-brand); font-weight: 600; }
label { color: var(--ui-ink-2); }

/* ---------- 表格 ---------- */
.table-wrap { background: #fff; border-color: var(--ui-line); border-radius: 12px; }
th { background: #f8f9fc; color: var(--ui-muted); font-size: .76rem; font-weight: 600; letter-spacing: .02em; }
th, td { border-bottom-color: #eef0f5; }
tbody tr { transition: background .12s; }
tbody tr:hover > td { background: #fafbff; }
td a { color: var(--ui-brand); }
.order-no, .numeric-cell, .num { font-variant-numeric: tabular-nums; }

/* 订单备注：仍是醒目的黄色，但更轻 */
.order-note { background: #fffbeb; border: 0; border-left: 3px solid #f59e0b; border-radius: 8px; box-shadow: inset 0 0 0 1px #fde68a; }

/* ---------- 标签 / 状态 ---------- */
.status-pill, .warning-badge { border-radius: 999px; font-weight: 600; padding: .2rem .6rem; }

/* ---------- 子页签（筛选标签） ---------- */
.workspace-filter-tabs a { border-radius: 999px; }

/* ---------- 页面提示：浮在右上角，确认类自动消失 ---------- */
.system-message-list {
  display: grid;
  gap: .6rem;
  margin: 0;
  max-width: min(26rem, calc(100vw - 2rem));
  position: fixed;
  right: 1rem;
  top: 4.25rem;
  z-index: 60;
}
.system-message-list > .system-message {
  animation: ui-toast-in .3s cubic-bezier(.2, .8, .2, 1) both;
  background: #fff;
  border: 1px solid var(--ui-line);
  border-left: 4px solid var(--ui-success);
  border-radius: 12px;
  box-shadow: var(--ui-shadow-lg);
  color: var(--ui-ink);
  line-height: 1.55;
  padding: .8rem 2.4rem .8rem 1rem;
  position: relative;
}
.system-message-list > .system-message.is-error { border-left-color: var(--ui-danger); }
.system-message-list > .system-message.is-warning { border-left-color: var(--ui-warn); }
.system-message-list > .system-message.is-info { border-left-color: var(--ui-brand); }
.system-message-list > .system-message.is-leaving { opacity: 0; transform: translateX(12px); transition: opacity .25s, transform .25s; }
.system-message-close {
  background: transparent;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  color: var(--ui-faint);
  font-size: 1.1rem;
  line-height: 1;
  min-height: 0;
  padding: .25rem .4rem;
  position: absolute;
  right: .4rem;
  top: .45rem;
  width: auto;
}
.system-message-close:hover { background: #f1f3f8; color: var(--ui-ink); }
:not(.system-message-list) > .system-message { border-radius: 12px; }

/* ---------- 右下角反馈 ---------- */
.feedback-widget > summary {
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  box-shadow: var(--ui-shadow-lg);
  color: var(--ui-brand);
  font-weight: 600;
}
.feedback-widget form { border-radius: 16px; box-shadow: var(--ui-shadow-lg); }

/* ---------- 登录页 ---------- */
.auth-card {
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  box-shadow: var(--ui-shadow-lg);
  margin-top: 8vh;
  max-width: 400px;
  padding: 2rem 2rem 1.75rem;
}
.auth-card h1 { font-size: 1.4rem; margin: .25rem 0 1.25rem; }
.auth-card .brand-mark { height: 2.75rem; width: 2.75rem; border-radius: 14px; }
.auth-card .brand-mark svg { height: 1.5rem; width: 1.5rem; }
.auth-card .auth-subtitle { color: var(--ui-muted); font-size: .875rem; margin: -.9rem 0 1.25rem; }
.auth-card button[type="submit"] { margin-top: .5rem; min-height: 2.9rem; }

/* 老板工作台月份选择：原来被挤成一列竖排的字，改为紧凑的一组（说明文字只给读屏用） */
.owner-period-control { align-items: center; flex: 0 0 auto; flex-wrap: nowrap; }
.owner-period-control label { clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.owner-period-control button { white-space: nowrap; width: auto; }
@media (max-width: 760px) { .owner-period-control { display: flex; flex-wrap: wrap; width: 100%; } .owner-period-control input { flex: 1 1 9rem; } }

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  .header-search { display: none; }
  .header-user-text { display: none; }
  .site-header { min-height: 3.25rem; padding-block: .45rem; }
  .brand { font-size: .95rem; }
  .brand-mark { height: 1.8rem; width: 1.8rem; }
  .system-message-list { left: 1rem; max-width: none; top: 3.6rem; }
}

@keyframes ui-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ui-toast-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 新建报单页：原来是另一套绿色，改成同一主色 */
.sales-order-page {
  --order-accent: var(--ui-brand);
  --order-accent-dark: var(--ui-brand-strong);
  --order-ink: var(--ui-ink);
  --order-muted: var(--ui-muted);
  --order-line: var(--ui-line);
  --order-soft: #f6f7fb;
}

/* 提交中 (2026-11-06): a pressed form stays pressed until the next page arrives. */
form.is-submitting :is(button[type="submit"], button:not([type])) { cursor: progress; opacity: .6; }

/* 补货计划：删除 */
.replenishment-delete-form { display: inline; margin-left: .75rem; }
.replenishment-delete-button { background: none; border: 0; box-shadow: none; color: #b91c1c; cursor: pointer; font-size: .85rem; min-height: 0; padding: 0; width: auto; }
.replenishment-delete-button:hover { text-decoration: underline; }
.replenishment-delete-card { align-items: center; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.replenishment-delete-card h2 { font-size: 1rem; margin: 0 0 .25rem; }
.replenishment-delete-card button { width: auto; }

/* 财务核款“新提交”标签：白字配浅橙底太淡，底色加深（2026-11-06 全站对比度检查） */
.page-content .review-unread-badge { background: #b45309; color: #fff; }

/* 本月目标进度：今天应到 / 每天需 / 有望冲刺（2026-11-06） */
.goal-pace { margin-top: .4rem; }
.goal-pace-bar { position: relative; padding-top: 1.6rem; margin-bottom: .5rem; }
.goal-pace-bar .progress-track { height: .8rem; }
.goal-pace-done .progress-fill { background: linear-gradient(90deg, #16a34a, #059669); }
.goal-pace-marker { position: absolute; bottom: -.3rem; height: 1.4rem; width: 2px; margin-left: -1px; background: #1f2937; border-radius: 1px; }
.goal-pace-marker-label { position: absolute; top: 0; transform: translateX(-50%); font-size: .78rem; color: #475569; white-space: nowrap; }
.goal-pace-marker-label.at-start { transform: translateX(-4px); }
.goal-pace-marker-label.at-end { transform: translateX(calc(-100% + 4px)); }
.goal-pace-end { position: absolute; top: 0; right: 0; font-size: .78rem; font-weight: 600; color: #c2410c; }
.goal-pace-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.goal-pace-chip { display: inline-flex; align-items: baseline; gap: .35rem; padding: .25rem .65rem; border-radius: 8px; font-size: .85rem; }
.goal-pace-chip b { font-size: 1rem; font-weight: 600; }
.goal-pace-chip.is-behind { background: #fff7ed; color: #b45309; }
.goal-pace-chip.is-daily { background: var(--ui-brand-soft, #eef2ff); color: var(--ui-brand-strong, #3730a3); }
.goal-pace-chip.is-ahead { background: #ecfdf5; color: #047857; }
.goal-pace-sprint { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .6rem 0; padding: .8rem 1rem; border-radius: 12px; color: #fff; background: radial-gradient(circle at 0 0, rgba(255,255,255,.2), transparent 60%), #c2410c; box-shadow: 0 6px 16px rgba(194, 65, 12, .25); }
.goal-pace-sprint span { display: block; font-size: .85rem; font-weight: 500; }
.goal-pace-sprint strong { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; margin-top: .15rem; }
.goal-pace-sprint p { margin: 0; text-align: right; font-size: .85rem; }
.goal-pace-sprint p b { font-size: 1.15rem; font-weight: 700; }
.goal-pace-sprint p small { display: block; font-size: .78rem; opacity: .95; }
.goal-pace-tag { display: inline-block; margin-top: .2rem; padding: .05rem .45rem; border-radius: 6px; font-size: .75rem; white-space: nowrap; }
.goal-pace-tag.is-behind { background: #fff7ed; color: #b45309; }
.goal-pace-tag.is-ahead { background: #fff1e6; color: #c2410c; font-weight: 600; }
.ck-progress + .goal-pace-tag { margin-left: 0; }
.owner-team-goal { margin-bottom: 1rem; }
.owner-team-goal .section-heading > strong { color: var(--ui-brand, #4f46e5); font-size: 1.3rem; }
/* 负责人首页：团队目标下面紧接每人完成情况（2026-11-06） */
.manager-reconciliation .manager-team-progress .reconciliation-table-heading { margin-top: 0; }
.manager-team-progress .reconciliation-table-heading h2 { margin: 0; font-size: 1.1rem; }
