/* 国医小镇后台：与客户界面共用的暖米、松绿视觉语言。 */
@font-face {
  font-family: GuoyiAdminSerif;
  src: url("https://636c-cloud1-d6g9yzpjg80a6f869-1453322234.tcb.qcloud.la/assets/fonts/home-serif-20260911.woff2") format("woff2");
  font-display: swap;
}

:root {
  --primary: #1f4b36;
  --primary-hover: #173e2d;
  --primary-dark: #143729;
  --bg: #faf8f3;
  --panel: #fffefa;
  --surface: #fffefa;
  --surface-soft: #f4f5ee;
  --text: #183d2b;
  --text-primary: #183d2b;
  --text-secondary: #66746a;
  --muted: #758077;
  --border: #e6e8de;
  --success: #2e6f50;
  --danger: #a95043;
  --warning: #a98238;
  --sidebar: #143729;
  --sidebar-muted: #a9c0b0;
  --amber: #c9a84c;
  --shadow: 0 15px 35px rgba(26, 46, 32, .075);
  --shadow-soft: 0 8px 24px rgba(26, 46, 32, .055);
}

html, body { background: var(--bg); }
body {
  color: var(--text);
  font-family: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  background-image: none;
}

button, .btn, input, select, textarea { letter-spacing: 0; }
button, .btn { border-radius: 10px; font-weight: 600; }
button:focus-visible, .btn:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible,
summary:focus-visible { outline: 2px solid #b9943e; outline-offset: 3px; }
input, select, textarea {
  color: var(--text);
  background: #fffefa;
  border: 1px solid #dfe5da;
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 54, .11);
}
.btn-primary, button.btn-primary { box-shadow: none; }
.btn-primary:hover, button.btn-primary:hover {
  transform: none;
  box-shadow: 0 6px 18px rgba(31, 75, 54, .14);
}
.btn-secondary, button.btn-secondary { border-color: #dfe5da; }
.btn-secondary:hover, button.btn-secondary:hover { background: #eef3eb; }
.btn-danger, button.btn-danger { background: var(--danger); }

.app-view { grid-template-columns: 248px minmax(0, 1fr); background: var(--bg); }
.sidebar {
  padding-bottom: 22px;
  background: var(--sidebar);
  box-shadow: 8px 0 30px rgba(20, 55, 41, .08);
  scrollbar-color: #436753 transparent;
}
.sidebar-header {
  min-height: 80px;
  padding: 16px 22px;
  border-bottom-color: rgba(255,255,255,.1);
}
.sidebar .brand-icon, .login-card .brand-icon {
  color: #143729;
  background: var(--amber);
  border-radius: 8px;
  box-shadow: none;
  font-family: GuoyiAdminSerif, "Noto Serif SC", "Songti SC", serif;
}
.sidebar .brand-text strong, .login-brand h1 {
  font-family: GuoyiAdminSerif, "Noto Serif SC", "Songti SC", serif;
  font-weight: 600;
  letter-spacing: .03em;
}
.sidebar .brand-text span { color: #afc4b4; letter-spacing: .04em; }
.nav-group { margin: 0 14px 7px; }
.nav-group-title {
  min-height: 42px;
  padding: 8px 10px;
  color: #a8bfaf;
  border-radius: 9px;
  font-size: 12px;
  letter-spacing: .04em;
}
.nav-group-title:hover { color: #fffefa; background: rgba(255,255,255,.06); }
.nav-list .nav-item {
  min-height: 44px;
  margin: 2px 0;
  padding: 10px 13px;
  color: #d5e3d6;
  border-radius: 10px;
  font-size: 14px;
}
.nav-list .nav-item::before { display: none; }
.nav-list .nav-item:hover { color: #fffefa; background: #27543e; transform: none; }
.nav-list .nav-item.active {
  color: #fffefa;
  background: #2d6149;
  box-shadow: none;
}

.main { min-width: 0; background: var(--bg); }
.topbar {
  min-height: 76px;
  padding: 12px clamp(20px, 2.5vw, 36px);
  background: #fffefa;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.breadcrumb { color: var(--muted); }
.breadcrumb-current { color: var(--text); }
.search-box { border-radius: 999px; background: #f4f5ef; border-color: transparent; }
.search-input { background: transparent; }
.content { max-width: 1680px; padding: 30px 32px 56px; }
.page-header { margin: 0 0 24px; padding: 0; }
.page-header::before { display: none; }
.page-title {
  margin-bottom: 6px;
  color: var(--text);
  font-family: GuoyiAdminSerif, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(25px, 2.3vw, 34px);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.3;
}
.page-subtitle { color: var(--muted); font-size: 14px; }

.dashboard-intro {
  position: relative;
  min-height: 142px;
  margin-bottom: 24px;
  padding: 24px 32px;
  overflow: hidden;
  border: 1px solid #e1e8dc;
  border-radius: 18px;
  background: #eaf0e7;
  box-shadow: var(--shadow-soft);
}
.dashboard-intro::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: min(35%, 390px);
  background: linear-gradient(90deg, #eaf0e7, rgba(234,240,231,.06) 50%),
    url("https://636c-cloud1-d6g9yzpjg80a6f869-1453322234.tcb.qcloud.la/assets/images/home/home-garden-20260910.jpg") center 45% / cover;
}
.dashboard-intro > * { position: relative; z-index: 1; }
.dashboard-intro-eyebrow { display: block; margin-bottom: 8px; color: var(--primary); font-size: 13px; }
.dashboard-intro h2 {
  margin: 0 0 7px;
  color: var(--text);
  font: 600 clamp(22px, 2.1vw, 29px)/1.35 GuoyiAdminSerif, "Noto Serif SC", "Songti SC", serif;
}
.dashboard-intro p { margin: 0; color: #69796c; font-size: 14px; }

.dashboard-quick-panel, .workbench-panel { margin-bottom: 24px; }
.section-heading-row { margin-bottom: 12px; }
.section-heading-row h2, .workbench-title,
.panel-header h3, .panel-title {
  color: var(--text);
  font-family: GuoyiAdminSerif, "Noto Serif SC", "Songti SC", serif;
  font-weight: 600;
  letter-spacing: .01em;
}
.section-heading-row h2, .workbench-title { font-size: 21px; }
.workbench-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.workbench-header {
  min-height: 60px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
}
.workbench-sub { color: var(--muted); font-size: 13px; }
.workbench-grid { gap: 12px; padding: 0; }
.workbench-chip {
  min-height: 119px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffefa;
  box-shadow: var(--shadow-soft);
}
.workbench-chip:hover, .workbench-chip.is-active {
  border-color: #b7d1bd;
  border-radius: 16px;
  background: #f3f7f1;
  box-shadow: var(--shadow-soft);
  transform: none;
}
.workbench-chip-count, .stat-value,
.finance-metric strong, .finance-summary-line strong {
  color: var(--text);
  font-family: GuoyiAdminSerif, "Noto Serif SC", "Songti SC", serif;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.workbench-chip-label { color: #647568; font-size: 14px; }
.dashboard-quick-grid {
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.dashboard-quick-action, .dashboard-quick-action:last-child {
  min-height: 92px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffefa;
  box-shadow: var(--shadow-soft);
}
.dashboard-quick-action:hover { border-color: #bad1bd; background: #f3f7f1; }
.dashboard-quick-action::after { color: var(--primary); }

.stats-grid { gap: 14px; margin-bottom: 20px; }
.stat-card {
  min-height: 132px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffefa;
  box-shadow: var(--shadow-soft);
}
.stat-card::after { display: none; }
.stat-card:nth-child(n) { border-top: 1px solid var(--border); }
.stat-card:hover { transform: none; box-shadow: var(--shadow); }
.stat-label { margin-bottom: 15px; color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.stat-value { font-size: clamp(27px, 2.3vw, 34px); letter-spacing: 0; }
.dashboard-deep-analysis {
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffefa;
}
.dashboard-deep-analysis > summary {
  padding: 16px 20px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.dashboard-deep-analysis[open] > summary { border-bottom: 1px solid var(--border); }
.dashboard-deep-analysis > .stats-grid,
.dashboard-deep-analysis > .chart-grid { margin: 18px 20px; }

.panel {
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fffefa;
  box-shadow: var(--shadow-soft);
}
.panel-header {
  min-height: 64px;
  padding: 18px 22px;
  background: #fffefa;
}
.panel-header h3, .panel-title { padding-left: 0; font-size: 19px; }
.panel-header h3::before, .panel-title::before { display: none; }
.list-toolbar {
  min-height: 60px;
  margin-bottom: 16px;
  padding: 14px 16px;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fffefa;
  box-shadow: var(--shadow-soft);
}
.list-toolbar input, .list-toolbar select { min-height: 42px; }
.quick-filters { gap: 9px; margin: 0 0 16px; padding: 0; border-bottom: 0; }
.filter-chip {
  min-height: 37px;
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #506854;
  background: #eef3eb;
  font-weight: 500;
}
.filter-chip:hover { color: var(--primary); background: #e4eee2; }
.filter-chip.active { color: #fffefa; background: var(--primary); border-color: var(--primary); }
.toolbar-note-block { margin: 0 0 18px; padding: 0; border: 0; color: var(--muted); }
.admin-data-table th, th {
  padding: 13px 16px;
  color: #68776b;
  background: #f4f5ef;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}
.admin-data-table td, td { padding: 16px; border-bottom: 1px solid var(--border); }
.admin-data-table tbody tr:nth-child(even) { background: transparent; }
.admin-data-table tbody tr:hover { background: #f7faf5; }
.pagination { padding: 16px 20px; }
.badge, .status-badge { border-radius: 999px; }
.empty { padding: 42px 24px; color: var(--muted); }
.alert-bar { border-radius: 14px; }

.advanced-filters, .advanced-config, .drawer-more {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8f9f4;
}
.advanced-filters { width: 100%; padding: 0 14px; }
.advanced-filters summary, .advanced-config summary, .drawer-more summary {
  padding: 11px 2px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}
.advanced-filters-body { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 4px 0 14px; }
.advanced-filters-body label { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); }
.advanced-filters-body label input[type="checkbox"] { width: auto; min-height: 0; }
.advanced-filters-body .btn { min-height: 40px; }
.advanced-config, .drawer-more { padding: 0 16px; }
.advanced-config[open], .drawer-more[open], .advanced-filters[open] { background: #f5f7f0; }
.form-help { color: var(--muted); }
.modal-card, .drawer-panel { border-color: var(--border); border-radius: 18px; box-shadow: 0 25px 60px rgba(20,55,41,.16); }
.modal-header, .drawer-header { padding: 20px 24px; background: #fffefa; }
.drawer-body { padding: 24px; }
.modal-form, .form-grid { gap: 16px; }
.modal-form label, .form-grid label { color: var(--text-secondary); }
.drawer-actions { gap: 10px; padding-top: 22px; }
.drawer-order-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid #e0e8dc;
  border-radius: 14px;
  background: #edf3e9;
}
.drawer-order-summary strong { display: block; margin-bottom: 3px; color: var(--text); font: 600 21px/1.4 GuoyiAdminSerif, "Noto Serif SC", serif; }
.drawer-order-summary p { margin: 0; color: var(--muted); font-size: 13px; }
.drawer-order-summary .amount { color: var(--text); font: 600 22px/1.4 GuoyiAdminSerif, "Noto Serif SC", serif; }
.drawer-section-title { margin: 4px 0 0; font: 600 19px/1.4 GuoyiAdminSerif, "Noto Serif SC", serif; }
.drawer-more { grid-column: 1 / -1; }
.drawer-more .form-grid { padding-bottom: 16px; }

.login-view {
  grid-template-columns: minmax(280px, .9fr) minmax(420px, 1.1fr);
  background: var(--bg);
}
.login-view::before {
  content: "山水之间  遇见国医";
  align-items: flex-end;
  color: #fffefa;
  background: linear-gradient(180deg, rgba(20,55,41,.04), rgba(20,55,41,.8)),
    url("https://636c-cloud1-d6g9yzpjg80a6f869-1453322234.tcb.qcloud.la/assets/images/home/home-garden-20260910.jpg") center / cover;
  font: 600 clamp(27px, 3vw, 45px)/1.4 GuoyiAdminSerif, "Noto Serif SC", "Songti SC", serif;
  letter-spacing: .08em;
}
.login-card { border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.login-card .brand-icon { box-shadow: none; }
.login-lead { color: var(--muted); }
.toast { border-left-color: var(--amber); border-radius: 10px; background: #143729; }

@media (max-width: 1100px) {
  .app-view { grid-template-columns: 226px minmax(0,1fr); }
  .content { padding: 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .app-view { display: block; }
  .content { padding: 22px 16px 104px; }
  .topbar { min-height: 62px; padding: 9px 16px; }
  .dashboard-intro { min-height: 128px; padding: 20px; }
  .dashboard-intro::after { width: 34%; }
  .mobile-quick-nav {
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--border);
    background: rgba(255,254,250,.98);
    box-shadow: 0 -8px 25px rgba(20,55,41,.06);
  }
  .mobile-quick-nav-item { color: var(--muted); border-radius: 10px; }
  .mobile-quick-nav-item:hover, .mobile-quick-nav-item.active,
  .mobile-quick-nav-item.is-active { color: var(--primary); background: #edf3e9; }
  .login-view { grid-template-columns: 1fr; padding: 24px; }
  .login-view::before { display: none; }
}
@media (max-width: 640px) {
  .orders-table .col-distribution, .orders-table .col-commission { display: none; }
  .orders-table .admin-data-table td.actions { width: 100%; white-space: normal; }
  .orders-table .order-row-actions { width: 100%; display: flex; gap: 8px; }
  .orders-table .mobile-card-table td.actions .order-row-actions > .btn { flex: 1 1 auto; min-height: 42px; }
  .orders-table .order-more { flex: 0 0 44px; }
  .orders-table .order-more-toggle { width: 44px; min-height: 42px; }
  .page-header { margin-bottom: 20px; }
  .page-title { font-size: 27px; }
  .dashboard-intro::after { opacity: .15; width: 55%; }
  .workbench-grid, .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workbench-chip { min-height: 112px; padding: 16px; }
  .dashboard-quick-grid { grid-template-columns: 1fr; }
  .dashboard-quick-action { min-height: 76px; }
  .panel-header { align-items: flex-start; flex-direction: column; padding: 16px; }
  .list-toolbar { padding: 14px; }
  .list-toolbar input, .list-toolbar select { width: 100%; }
  .advanced-filters-body { display: grid; grid-template-columns: 1fr; }
  .advanced-filters-body select, .advanced-filters-body .btn { width: 100%; }
  .modal-card, .drawer-panel { border-radius: 14px; }
  .drawer-body { padding: 18px; }
  .drawer-order-summary { grid-template-columns: 1fr; }
}

/* 手机后台：顶部信息分行展示，列表卡片按屏宽完整排布。 */
@media (max-width: 640px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    gap: 8px;
    min-height: 0;
    padding: 8px 12px 10px;
  }
  .topbar-left { grid-column: 1; grid-row: 1; gap: 8px; min-width: 0; }
  .topbar-actions { display: contents; }
  .menu-toggle, .icon-btn.menu-toggle,
  .topbar .notify-btn { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
  .breadcrumb { min-width: 0; margin: 0; }
  .breadcrumb-current { font-size: 15px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
  .topbar .notify-btn { grid-column: 2; grid-row: 1; }
  .topbar .user-menu { grid-column: 3; grid-row: 1; }
  .topbar .user-menu-toggle { width: 40px; height: 40px; padding: 3px; justify-content: center; }
  .topbar .user-avatar { flex: 0 0 30px; width: 30px; height: 30px; }
  .topbar .user-menu-caret { display: none; }
  .topbar .search-box { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; min-width: 0; }
  .topbar .search-input { width: 100%; height: 38px; min-width: 0; font-size: 14px; }
  .topbar .global-search-results { width: 100%; max-height: min(55vh, 360px); }

  .content { padding: 16px 12px calc(88px + env(safe-area-inset-bottom)); }
  .page-header { margin-bottom: 14px; }
  .page-title { font-size: 23px; }
  .panel-header { padding: 12px 14px; }

  .mobile-card-table, .mobile-card-table .admin-data-table,
  .mobile-card-table .admin-data-table tbody,
  .mobile-card-table .admin-data-table tr { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
  .mobile-card-table .admin-data-table tbody { gap: 10px; }
  .mobile-card-table .admin-data-table tr { padding: 12px 14px; }
  .mobile-card-table .admin-data-table td {
    width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
    gap: 10px; padding: 7px 0; white-space: normal;
    overflow-wrap: anywhere; word-break: normal;
    font-size: 13px; line-height: 1.45;
  }
  .mobile-card-table .admin-data-table td::before {
    flex: 0 0 min(22vw, 76px); max-width: min(22vw, 76px);
    font-size: 12px; line-height: 1.45;
  }
  .mobile-card-table .admin-data-table td:first-child::before { display: none; }
  .mobile-card-table .admin-data-table td > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .mobile-card-table .admin-data-table td .order-no { word-break: break-word; overflow-wrap: anywhere; }
  .mobile-card-table .admin-data-table .order-goods-line,
  .mobile-card-table .admin-data-table .order-goods-info { min-width: 0; max-width: 100%; }
  .mobile-card-table .admin-data-table .order-goods-line { flex: 1 1 0; }
  .mobile-card-table .admin-data-table .cell-title,
  .mobile-card-table .admin-data-table .cell-sub { white-space: normal; overflow-wrap: anywhere; }

  .mobile-card-table .admin-data-table td.actions {
    display: grid; width: 100%; min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px; white-space: normal;
  }
  .mobile-card-table .admin-data-table td.actions::before {
    grid-column: 1 / -1; max-width: none; margin: 0;
  }
  .mobile-card-table .admin-data-table td.actions > .btn,
  .mobile-card-table .admin-data-table td.actions .order-row-actions > .btn {
    width: 100%; min-width: 0; min-height: 38px;
    padding: 7px 8px; font-size: 13px; line-height: 1.25;
    white-space: normal; word-break: keep-all;
  }
  .mobile-card-table .admin-data-table td.actions > .order-row-actions {
    grid-column: 1 / -1; display: grid; width: 100%; min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  }
  .mobile-card-table .admin-data-table td.actions .order-more { min-width: 0; }
  .mobile-card-table .admin-data-table td.actions .order-more-toggle { width: 100%; }
  .mobile-card-table .admin-data-table td.actions select { width: 100%; min-width: 0; }
  .pagination { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .pagination > span { flex: 1 1 100%; }
}
