:root {
  --bg: #eef3f6;
  --panel: #ffffff;
  --panel-soft: #f6f8f7;
  --ink: #14201c;
  --muted: #66736e;
  --line: #d7e0dc;
  --line-strong: #bfccc6;
  --primary: #0f766e;
  --primary-dark: #0b4f4a;
  --primary-weak: #dff4ef;
  --accent: #c47a26;
  --success: #16803c;
  --warning: #b25f00;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(20, 32, 28, 0.1);
  --shadow-soft: 0 8px 24px rgba(20, 32, 28, 0.07);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(15, 118, 110, 0.12), transparent 32rem),
    radial-gradient(circle at 92% 12%, rgba(196, 122, 38, 0.14), transparent 28rem),
    linear-gradient(180deg, #f8fbf9 0%, var(--bg) 38%, #e9f0ed 100%);
  font-family:
    "Avenir Next", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
    sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.app-header {
  min-height: 76px;
  padding: 14px clamp(16px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.22);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0;
}

.brand-block p,
.page-head p,
.section-title span,
.hint,
.sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip,
.status-pill {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.status-pill.done {
  color: var(--success);
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.status-pill.pending {
  color: var(--warning);
  background: #fffbeb;
  border-color: #fde68a;
}

.status-pill.score.strong,
.score-text.strong {
  color: var(--success);
}

.status-pill.score.weak,
.score-text.weak {
  color: var(--danger);
}

.status-pill.score.neutral,
.score-text.neutral {
  color: var(--muted);
}

.btn {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  background: var(--panel);
  color: var(--ink);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 10px 18px rgba(15, 118, 110, 0.18);
}

.btn.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.module-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(16px, 3vw, 34px);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  position: sticky;
  top: 75px;
  z-index: 19;
}

.nav-item {
  height: 54px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 16px 16px 0 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-weak);
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
}

.content-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 34px) 36px;
}

.detail-week-field {
  min-width: 160px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 220ms ease both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 2px 2px 0;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.section-block {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.mt {
  margin-top: 16px;
}

.section-title {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-page-actions {
  justify-content: flex-end;
}

.admin-collapsible {
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.admin-collapsible .section-title {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.05), rgba(255, 255, 255, 0.94)),
    rgba(255, 255, 255, 0.92);
}

.admin-collapsible-body {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 220ms ease,
    opacity 180ms ease;
}

.admin-collapsible-body > * {
  min-height: 0;
  overflow: hidden;
}

.admin-collapsible.collapsed {
  box-shadow: 0 10px 22px rgba(20, 32, 28, 0.05);
}

.admin-collapsible.collapsed .section-title {
  border-bottom-color: transparent;
}

.admin-collapsible.collapsed .admin-collapsible-body {
  grid-template-rows: 0fr;
  opacity: 0;
}

.admin-toggle-btn {
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.admin-toggle-btn::after {
  content: "▾";
  font-size: 12px;
  line-height: 1;
  transition: transform 180ms ease;
}

.admin-toggle-btn[aria-expanded="false"]::after {
  transform: rotate(-90deg);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.calendar-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.calendar-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 12px;
}

.calendar-hero-main,
.calendar-hero-side {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.calendar-hero-main {
  background:
    radial-gradient(circle at right top, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.96));
}

.calendar-hero-side {
  background:
    radial-gradient(circle at left bottom, rgba(196, 122, 38, 0.14), transparent 36%),
    rgba(255, 255, 255, 0.9);
}

.calendar-hero span,
.calendar-day span,
.calendar-day em,
.calendar-hero em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.calendar-hero strong {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.calendar-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-day {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  gap: 5px;
  min-height: 98px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.calendar-day strong {
  font-size: 18px;
  line-height: 1.1;
}

.calendar-day.is-cycle {
  border-color: rgba(15, 118, 110, 0.38);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.1);
}

.calendar-day.is-today,
.calendar-day.is-cycle.is-today {
  transform: translateY(-2px);
}

.calendar-day.is-today strong {
  color: var(--primary-dark);
}

.calendar-day.is-past:not(.is-today) {
  background: rgba(246, 248, 247, 0.86);
}

.metric {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 247, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -30px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  position: relative;
  z-index: 1;
}

.progress-list,
.assignment-list,
.product-card-list,
.org-user-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.progress-item,
.assignment-item,
.product-card,
.org-user-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(20, 32, 28, 0.03);
}

.product-card {
  display: grid;
  gap: 14px;
}

.progress-row,
.product-card-head,
.assignment-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.progress-bar {
  height: 9px;
  background: #e9efec;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #46b79f);
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.field.compact {
  min-width: 180px;
}

select,
input,
textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.sales-toolbar {
  grid-template-columns: minmax(320px, 1.25fr) minmax(150px, 200px) minmax(150px, 200px) minmax(160px, 210px);
}

.sales-view-field {
  min-width: 160px;
}

.sales-view-toggle {
  width: 100%;
}

.sales-view-toggle .segment {
  flex: 1 1 0;
}

.search-field input {
  padding-left: 14px;
}

.sales-search-meta {
  margin: -2px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92));
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sales-search-meta strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.sales-search-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.segmented {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eef4f1;
  padding: 4px;
}

.segment {
  min-height: 32px;
  border: 0;
  border-radius: 10px;
  padding: 6px 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.segment.active {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 4px 12px rgba(20, 32, 28, 0.08);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f4f7f5;
  color: var(--muted);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:last-child td {
  border-bottom: 0;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(15, 118, 110, 0.28);
  text-underline-offset: 4px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.product-card-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.purchase-mobile-list {
  padding-top: 12px;
}

.purchase-task-card {
  gap: 12px;
}

.purchase-task-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.42fr);
  gap: 10px;
}

.purchase-task-block {
  min-width: 0;
}

.purchase-task-block strong {
  font-size: 16px;
  line-height: 1.4;
  word-break: break-word;
}

.purchase-task-block em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.purchase-task-meta {
  margin-top: 10px;
}

.purchase-task-foot {
  padding-top: 4px;
}

.purchase-task-actions {
  justify-content: flex-end;
}

.sales-snapshot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.28fr);
  gap: 12px;
}

.snapshot-main,
.snapshot-side {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.snapshot-main {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.8)),
    var(--panel-soft);
}

.snapshot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.snapshot-title em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.snapshot-main span,
.snapshot-side span,
.sales-card-foot {
  color: var(--muted);
  font-size: 12px;
}

.price-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.price-timeline.empty {
  min-height: 78px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.price-point {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.74);
  display: grid;
  gap: 5px;
}

.price-point.latest {
  border-color: rgba(15, 118, 110, 0.34);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.08);
}

.price-point strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.snapshot-side strong {
  font-size: 16px;
  line-height: 1.35;
}

.analysis-ok {
  color: var(--success);
}

.analysis-missing {
  color: var(--warning);
}

.snapshot-side em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.sales-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.sales-card-mobile .sales-card-foot .btn {
  min-width: 112px;
}

.sales-matrix-shell {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.matrix-hint {
  color: var(--muted);
  font-size: 12px;
  padding: 0 2px;
}

.sales-matrix-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: auto;
  max-height: calc(100vh - 260px);
  box-shadow: var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sales-matrix {
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
}

.sales-matrix th,
.sales-matrix td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.sales-matrix th {
  top: 0;
  z-index: 5;
  white-space: nowrap;
}

.sales-matrix .sticky-col {
  position: sticky;
  z-index: 4;
}

.sales-matrix th.sticky-col {
  z-index: 7;
}

.sales-matrix .product-col {
  left: 0;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.sales-matrix .category-col {
  left: 210px;
  width: 102px;
  min-width: 102px;
  max-width: 102px;
}

.sales-matrix .date-col {
  min-width: 138px;
  width: 138px;
  text-align: center;
  color: var(--primary-dark);
  font-weight: 800;
}

.sales-matrix .price-cell {
  min-width: 138px;
  width: 138px;
  line-height: 1.45;
  word-break: break-word;
}

.matrix-product-card {
  display: grid;
  gap: 5px;
}

.matrix-product-link {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.matrix-owner-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 0 9px;
  border-radius: 999px;
  background: #f5f8f6;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-cell-inner {
  position: relative;
  min-height: 56px;
  padding: 18px 10px 10px;
}

.price-cell-text {
  display: block;
}

.sales-matrix .price-cell.has-period-analysis {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(255, 255, 255, 0.98)),
    #fff;
}

.cell-analysis-flag {
  position: absolute;
  top: 8px;
  right: 10px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 128, 60, 0.12);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.sales-matrix .latest-price-col {
  background: #f1faf7;
}

.sales-matrix .product-col {
  box-shadow: 8px 0 16px rgba(20, 32, 28, 0.05);
}

.sales-matrix td.product-col {
  vertical-align: top;
}

.sales-matrix td.product-col span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.matrix-analysis-line {
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 9px;
  line-height: 1.25;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-analysis-line.has-analysis {
  color: var(--success);
  background: #ecfdf3;
}

.matrix-analysis-line.no-analysis {
  color: var(--warning);
  background: #fffbeb;
}

.muted-dash {
  color: #b5c0bb;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.detail-summary-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #ffffff, #f4f8f6);
  box-shadow: var(--shadow-soft);
}

.detail-summary-card span {
  color: var(--muted);
  font-size: 12px;
}

.detail-summary-card strong {
  font-size: 18px;
  line-height: 1.35;
}

.detail-summary-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}

.field-hint-inline {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.detail-stack {
  display: grid;
  gap: 16px;
}

.detail-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-section-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-weak);
  font-size: 12px;
  font-weight: 700;
}

.detail-panel {
  overflow: hidden;
}

.detail-panel-summary {
  cursor: pointer;
  list-style: none;
}

.detail-panel-summary::-webkit-details-marker {
  display: none;
}

.detail-panel-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.detail-panel-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.detail-panel-toggle::after {
  content: '展开';
}

.detail-panel[open] .detail-panel-toggle::after {
  content: '收起';
}

.price-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.price-list li {
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 116px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  background: var(--panel-soft);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.price-list li:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 32, 28, 0.06);
}

.price-list li.selected-cycle {
  border-color: rgba(15, 118, 110, 0.42);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.08);
}

.price-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.price-list-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.inline-tag.selected {
  color: var(--primary-dark);
  background: var(--primary-weak);
  border-color: rgba(15, 118, 110, 0.22);
}

.inline-tag.latest {
  color: var(--accent);
  background: rgba(196, 122, 38, 0.1);
  border-color: rgba(196, 122, 38, 0.22);
}

.price-list strong {
  font-size: 14px;
  line-height: 1.35;
}

.price-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.analysis-form {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.analysis-save-bar {
  grid-template-columns: auto;
  background: #fbfcfb;
}

.analysis-form .btn {
  justify-self: start;
}

.analysis-auto-meta {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.05), rgba(255, 255, 255, 0.9));
}

.analysis-auto-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.analysis-auto-card span,
.analysis-auto-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-style: normal;
}

.analysis-auto-card strong {
  font-size: 16px;
  line-height: 1.35;
}

.analysis-auto-card-wide {
  grid-column: span 3;
}

.analysis-periods {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.analysis-period-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.analysis-period-select-field {
  min-width: 0;
}

.analysis-period-select {
  min-width: 0;
}

.analysis-period-current {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.86));
  display: grid;
  gap: 5px;
}

.analysis-period-current strong {
  font-size: 15px;
  line-height: 1.35;
}

.analysis-period-current span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.analysis-period-current span:last-child {
  word-break: break-word;
}

.analysis-period {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}

.analysis-period.active {
  border-color: rgba(15, 118, 110, 0.42);
  background: var(--primary-weak);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.08);
}

.analysis-period span,
.analysis-period em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.analysis-period strong {
  font-size: 14px;
  line-height: 1.35;
}

.analysis-selected-meta {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.analysis-selected-meta div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.analysis-selected-meta strong {
  font-size: 15px;
}

.analysis-selected-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customs-data-block {
  display: grid;
}

.customs-placeholder {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px dashed rgba(15, 118, 110, 0.28);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(245, 250, 248, 0.98), rgba(255, 255, 255, 0.98));
}

.customs-placeholder strong {
  font-size: 18px;
}

.customs-placeholder span {
  color: var(--muted);
  line-height: 1.7;
}

.customs-placeholder-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(191, 219, 214, 0.8);
}

.customs-placeholder-meta label {
  color: var(--muted);
  font-size: 13px;
}

.customs-placeholder-meta b {
  font-size: 14px;
}

.analysis-score-select {
  min-width: 92px;
}

.detail-analysis-table-wrap {
  max-height: none;
  overflow: visible;
}

.mini {
  max-height: 420px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #14201c;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 180ms ease;
  z-index: 70;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(15, 118, 110, 0.22), transparent 28rem),
    rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 16px;
}

.login-overlay.show {
  display: flex;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.login-card h2 {
  font-size: 18px;
}

.password-login-section {
  display: grid;
  gap: 10px;
}

.login-mode-note {
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 14px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.5;
}

.dingtalk-login-box {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.hint {
  font-size: 12px;
}

.org-user-item {
  display: grid;
  gap: 8px;
}

.admin-editor-shell {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.admin-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.admin-form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px) auto;
}

.role-filter-grid,
.reminder-config-grid {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) auto;
}

.inline-note {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.product-crud-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.product-category-field {
  min-width: 220px;
}

.assignment-panel {
  display: grid;
  gap: 12px;
}

.assignment-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.assignment-search-field {
  min-width: min(320px, 100%);
}

.assignment-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.assignment-section-head strong {
  font-size: 14px;
}

.assignment-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.assignment-selected-block,
.assignment-results-block {
  display: grid;
  gap: 10px;
}

.assignment-selected-grid,
.assignment-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.assignment-selected-card,
.assignment-result-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  background: rgba(255, 255, 255, 0.82);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.assignment-result-card:hover,
.assignment-selected-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.assignment-selected-card {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.94)),
    #fff;
}

.assignment-result-card.checked {
  border-color: rgba(15, 118, 110, 0.34);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.95)),
    #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.08);
}

.assignment-action-btn {
  min-width: 72px;
}

.assignment-selected-card strong,
.assignment-selected-card span,
.assignment-selected-card em,
.assignment-result-card strong,
.assignment-result-card span,
.assignment-result-card em {
  display: block;
}

.assignment-selected-card span,
.assignment-selected-card em,
.assignment-result-card span,
.assignment-result-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-style: normal;
}

.assignment-empty-inline {
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 14px 12px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.54);
}

.org-user-item strong {
  font-size: 15px;
}

.org-user-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.hidden {
  display: none !important;
}

.empty-state {
  min-height: 116px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(8, 20, 18, 0.38);
  backdrop-filter: blur(8px);
}

.drawer-overlay.show {
  display: flex;
}

.drawer-panel {
  width: min(620px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(8, 20, 18, 0.22);
  padding: 18px;
  display: grid;
  gap: 14px;
  animation: drawerIn 220ms ease both;
}

@keyframes drawerIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.drawer-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-only {
  display: none !important;
}

.admin-mode .admin-only {
  display: inline-flex !important;
}

.admin-mode section.admin-only {
  display: block !important;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-rows: auto 1fr;
  }

  .app-header {
    min-height: 62px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  h1 {
    font-size: 17px;
  }

  h2 {
    font-size: 21px;
  }

  .brand-block p {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .user-chip {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .module-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: calc(62px + env(safe-area-inset-bottom));
    z-index: 60;
    padding: 0 6px env(safe-area-inset-bottom);
    justify-content: space-around;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(255, 255, 255, 0.96);
  }

  .nav-item {
    min-height: 62px;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0 4px;
    font-size: 12px;
    border-bottom: 0;
    border-top: 3px solid transparent;
    border-radius: 14px 14px 0 0;
  }

  .nav-item.active {
    border-top-color: var(--primary);
    border-bottom-color: transparent;
  }

  .content-shell {
    padding: 14px 12px calc(86px + env(safe-area-inset-bottom));
  }

  .nav-icon {
    font-size: 17px;
  }

  .page-head > div:first-child {
    min-width: 0;
  }

  .page-head h2 {
    font-size: 20px;
  }

  .page-head p,
  .section-title span,
  .sub {
    font-size: 12px;
  }

  .page-head,
  .section-title,
  .progress-row,
  .product-card-head,
  .assignment-head,
  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .sales-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .sales-toolbar .search-field {
    grid-column: 1 / -1;
  }

  .sales-view-field {
    grid-column: 1 / -1;
  }

  .field,
  .field.compact,
  .detail-week-field,
  .toolbar .btn,
  .toolbar select,
  .toolbar input {
    width: 100%;
    min-width: 0;
  }

  .segmented {
    width: 100%;
    justify-content: stretch;
  }

  .segment {
    flex: 1;
  }

  .detail-summary {
    grid-template-columns: 1fr;
  }

  .detail-panel-body {
    padding: 0 12px 12px;
  }

  .sales-snapshot {
    grid-template-columns: 1fr;
  }

  .purchase-task-grid {
    grid-template-columns: 1fr;
  }

  .calendar-hero {
    grid-template-columns: 1fr;
  }

  .calendar-week-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sales-matrix-wrap {
    max-height: calc(100vh - 230px);
  }

  .sales-search-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .sales-card-mobile .sales-card-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-task-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-task-actions {
    width: 100%;
  }

  .purchase-task-actions .btn {
    flex: 1 1 auto;
  }

  .price-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .price-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-auto-meta {
    grid-template-columns: 1fr;
  }

  .analysis-auto-card-wide {
    grid-column: span 1;
  }

  .analysis-form {
    grid-template-columns: 1fr;
  }

  .analysis-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 18px rgba(20, 32, 28, 0.06);
  }

  .analysis-periods,
  .analysis-selected-meta {
    grid-template-columns: 1fr;
  }

  .analysis-period-toolbar {
    grid-template-columns: 1fr;
  }

  .assignment-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-selected-grid,
  .assignment-results-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-row,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .role-filter-grid .page-actions,
  .admin-form-row .page-actions,
  .product-crud-actions .page-actions {
    width: 100%;
  }

  .role-filter-grid .page-actions .btn,
  .admin-form-row .page-actions .btn,
  .product-crud-actions .page-actions .btn {
    flex: 1 1 auto;
  }

  .admin-page-actions {
    width: 100%;
  }

  .admin-page-actions .btn {
    flex: 1;
  }

  .field.compact {
    min-width: 0;
  }

  .table-wrap {
    margin: 0 -1px;
  }

  table {
    min-width: 760px;
  }

  .header-actions .btn {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .login-card {
    width: min(480px, 100%);
    border-radius: 20px;
  }
}

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

  .price-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .price-list li {
    min-height: 0;
    padding: 12px;
  }

  .metric-value {
    font-size: 24px;
  }

  #triggerReminderBtn,
  #refreshBtn {
    display: none;
  }

  .app-header {
    align-items: flex-start;
  }

  .header-actions {
    max-width: 46%;
    display: grid;
    grid-auto-flow: row;
    justify-items: stretch;
  }

  .user-chip {
    max-width: 100%;
  }

  .page-head {
    gap: 10px;
    margin-bottom: 14px;
  }

  .calendar-week-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-day {
    min-height: 88px;
  }

  .section-block {
    border-radius: 16px;
  }

  .section-title,
  .calendar-panel,
  .admin-editor-shell,
  .sales-matrix-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .product-card-head .btn,
  .drawer-actions .btn,
  .page-actions .btn {
    width: 100%;
  }

  .sales-view-toggle {
    min-height: 44px;
  }

  .sales-view-toggle .segment {
    min-height: 36px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions > * {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
  }

  .sales-matrix-wrap {
    overflow: auto;
  }

  .sales-matrix thead {
    display: table-header-group;
  }

  .sales-matrix tbody {
    display: table-row-group;
  }

  .sales-matrix tr {
    display: table-row;
    width: auto;
    padding: 0;
    border-bottom: 0;
  }

  .sales-matrix th,
  .sales-matrix td {
    display: table-cell;
    width: auto;
    padding: 10px 11px;
  }

  .sales-matrix td::before {
    content: none;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  td {
    border-bottom: 0;
    padding: 7px 0;
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }

  td[colspan] {
    display: block;
  }

  td[colspan]::before {
    content: none;
  }

  .sales-matrix {
    min-width: 1180px;
  }

  .sales-matrix thead {
    display: table-header-group;
  }

  .sales-matrix tbody {
    display: table-row-group;
  }

  .sales-matrix tr {
    display: table-row;
    width: auto;
    padding: 0;
    border-bottom: 0;
  }

  .sales-matrix th,
  .sales-matrix td {
    display: table-cell;
    width: auto;
    padding: 10px 11px;
    border-bottom: 1px solid var(--line);
  }

  .sales-matrix td::before {
    content: none;
  }

  .sales-matrix .product-col {
    left: 0;
    width: 182px;
    min-width: 182px;
    max-width: 182px;
  }

  .sales-matrix .category-col {
    left: 182px;
    width: 90px;
    min-width: 90px;
    max-width: 90px;
  }

  .drawer-overlay {
    padding: 0;
  }

  .price-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawer-panel {
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    width: 100%;
    max-height: 92dvh;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  }

  .drawer-head {
    flex-direction: column;
  }

  .drawer-head .btn {
    width: 100%;
  }

  .login-overlay {
    padding: 0;
  }

  .login-card {
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: max(18px, env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: none;
  }
}
