/* 抽离自 index.html 头部 <style> (SPLIT_PLAN 批1, 2026-05-29) — 字节原样 */
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #F5F5F7; color: #1D1D1F; -webkit-font-smoothing: antialiased; }

  /* 布局 */
  .layout { display: flex; min-height: 100vh; }
  .sidebar {
    width: 220px; background: #1a1a2e; color: #fff;
    display: flex; flex-direction: column; flex-shrink: 0;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    overflow-y: auto;
  }
  .main { margin-left: 220px; flex: 1; display: flex; flex-direction: column; min-width: 0; }

  /* 侧边栏 */
  .sidebar-logo {
    padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px;
  }
  .logo-icon { font-size: 28px; }
  .logo-text { font-size: 18px; font-weight: 900; color: #FFBA08; }
  .logo-sub { font-size: 12px; color: rgba(255,255,255,0.5); }

  .nav-group { padding: 8px 0; }
  .nav-group-title {
    font-size: 11px; color: rgba(255,255,255,0.5); padding: 8px 16px; text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between;
    transition: color .15s, background .15s;
  }
  .nav-group-title:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,.04); }
  .nav-group-title::after {
    content: '▾'; font-size: 18px; font-weight: bold; color: rgba(255,255,255,.7); transition: transform .2s;
  }
  .nav-group.collapsed .nav-group-title::after { transform: rotate(-90deg); }
  .nav-group-items { overflow: hidden; max-height: 1500px; transition: max-height .25s ease; }
  .nav-group.collapsed .nav-group-items { max-height: 0; }
  /* 侧边栏滚动 */
  .sidebar { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
  .sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; font-size: 14px; color: rgba(255,255,255,0.7);
    cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent;
  }
  .nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
  .nav-item.active { background: rgba(0,122,255,0.18); color: #007AFF; border-left-color: #007AFF; }
  /* 苹果风默认主色（中央系统使用）；油小将品牌切换时通过 body.brand-youxiaojiang 还原橙色 */
  body.brand-youxiaojiang .nav-item.active { background: rgba(232,93,4,0.18); color: #FB8500; border-left-color: #E85D04; }
  .nav-icon { font-size: 16px; width: 20px; text-align: center; }

  /* 顶栏 */
  .topbar {
    background: #fff; padding: 0 24px; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid #E8E8E8; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky; top: 0; z-index: 50;
  }
  .topbar-title { font-size: 18px; font-weight: bold; color: #1a1a2e; }
  .topbar-right { display: flex; align-items: center; gap: 16px; }
  /* 品牌切换器 */
  .brand-switcher { position: relative; padding: 6px 14px; border: 1.5px solid #007AFF; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: #007AFF; background: #F0F7FF; user-select: none; transition: all .15s; }
  .brand-switcher:hover { background: #E0EEFF; }
  .brand-switcher.brand-youxiaojiang { background: linear-gradient(135deg, #FFF7EE, #FFE5CC); border-color: #E85D04; color: #E85D04; }
  .brand-switcher.brand-huiran { background: linear-gradient(135deg, #E8F4FF, #B3DBFF); border-color: #1677FF; color: #1677FF; }
  .brand-switcher.brand-haishuo { background: linear-gradient(135deg, #F3E8FF, #E0C3FC); border-color: #7B2CBF; color: #7B2CBF; }
  .brand-switcher.brand-central { background: linear-gradient(135deg, #1a1a2e, #2D3748); color: #FFBA08; border-color: #FFBA08; }
  .brand-menu { display: none; position: absolute; top: calc(100% + 4px); right: 0; background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); min-width: 220px; z-index: 100; overflow: hidden; }
  .brand-switcher.open .brand-menu { display: block; }
  .brand-item { padding: 10px 14px; font-size: 13px; color: #333; cursor: pointer; border-bottom: 1px solid #f5f5f5; font-weight: 500; }
  .brand-item:last-child { border-bottom: none; }
  .brand-item:hover { background: #FFF7EE; color: #E85D04; }
  .brand-item.active { background: #FFE5CC; color: #E85D04; font-weight: 700; }
  /* 顶栏品牌色横条 */
  .brand-bar { height: 3px; background: linear-gradient(90deg,#FB8500,#1677FF,#7B2CBF); }
  body.brand-youxiaojiang .brand-bar { background: linear-gradient(90deg,#FB8500,#E85D04); }
  body.brand-huiran .brand-bar { background: linear-gradient(90deg,#1677FF,#0052D9); }
  body.brand-haishuo .brand-bar { background: linear-gradient(90deg,#7B2CBF,#5A189A); }
  /* 中央总览导航卡：仅在中央模式（body.brand-central）显示；进入子品牌时隐藏 */
  body:not(.brand-central) #nav-central-overview { display: none !important; }

  .topbar-badge {
    background: #FFF0E5; color: #E85D04; padding: 4px 12px;
    border-radius: 20px; font-size: 13px; font-weight: bold;
  }
  .admin-info { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #666; }

  /* 内容区 */
  .content { padding: 24px; flex: 1; }

  /* 页面切换 */
  .page { display: none; }
  .page.active { display: block; }

  /* A4 打印盘点表（隐藏 layout，仅打印 #print-area）*/
  @media print {
    @page { size: A4; margin: 12mm; }
    body * { visibility: hidden !important; }
    #print-area, #print-area * { visibility: visible !important; }
    #print-area { position: absolute; left: 0; top: 0; width: 100%; }
    .print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .print-table th, .print-table td { border: 1px solid #000; padding: 6px 8px; }
    .print-table thead { display: table-header-group; } /* 跨页时表头自动重复 */
    .print-table tr { page-break-inside: avoid; }
    .no-print { display: none !important; }
  }
  #print-area { display: none; }
  body.printing-stock #print-area { display: block; }

  /* 平台总览 - 卡片可单击选中、双击跳转 */
  .dash-card {
    cursor: pointer; user-select: none; position: relative;
    transition: transform .12s ease, box-shadow .12s ease, outline-color .12s;
    outline: 2px solid transparent; outline-offset: 2px;
  }
  .dash-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.14) !important; }
  .dash-card.selected { outline-color: #E85D04; box-shadow: 0 0 0 4px rgba(232,93,4,.18) !important; }
  .dash-card::after {
    content: '双击查看 ›'; position: absolute; right: 10px; top: 8px;
    font-size: 10px; padding: 2px 6px; border-radius: 4px;
    pointer-events: none; opacity: 0; transition: opacity .15s;
  }
  .dash-card:hover::after, .dash-card.selected::after { opacity: 1; }
  .dash-card.tip-light::after { background: rgba(255,255,255,.22); color: #fff; }
  .dash-card.tip-dark::after  { background: rgba(0,0,0,.06); color: #999; }

  .dash-list-item {
    cursor: pointer; transition: background .12s, outline-color .12s;
    border-radius: 6px; outline: 1.5px solid transparent;
  }
  .dash-list-item:hover { background: rgba(232,93,4,.06); }
  .dash-list-item.selected { background: rgba(232,93,4,.12); outline-color: #E85D04; }

  /* 统计卡片 */
  .stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
  .stat-card {
    background: #fff; border-radius: 12px; padding: 20px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex; align-items: center; gap: 16px;
  }
  .stat-icon { font-size: 40px; }
  .stat-body { flex: 1; }
  .stat-num { font-size: 32px; font-weight: 900; color: #1a1a2e; }
  .stat-label { font-size: 13px; color: #999; margin-top: 4px; }
  .stat-trend { font-size: 12px; margin-top: 4px; }
  .trend-up { color: #52c41a; }
  .trend-down { color: #ff4d4f; }

  /* 工具栏 */
  .toolbar {
    background: #fff; border-radius: 12px; padding: 16px 20px;
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
    flex-wrap: wrap; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }
  .toolbar input, .toolbar select {
    height: 36px; padding: 0 12px; border: 1px solid #D9D9D9;
    border-radius: 6px; font-size: 14px; color: #333; outline: none;
    transition: border-color 0.2s;
  }
  .toolbar input:focus, .toolbar select:focus { border-color: #E85D04; }
  .toolbar input { width: 200px; }
  .toolbar select { min-width: 120px; }
  .toolbar label { font-size: 14px; color: #666; }
  .btn {
    height: 36px; padding: 0 16px; border-radius: 8px; border: none;
    cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.18s;
  }
  /* 苹果风主按钮（默认蓝；油小将品牌切换时仍橙色，保留品牌色） */
  .btn-primary-sm { background: #007AFF; color: #fff; }
  .btn-primary-sm:hover { background: #0066D6; box-shadow: 0 2px 8px rgba(0,122,255,.25); }
  body.brand-youxiaojiang .btn-primary-sm { background: #E85D04; }
  body.brand-youxiaojiang .btn-primary-sm:hover { background: #C94E02; box-shadow: 0 2px 8px rgba(232,93,4,.3); }
  .btn-default { background: #fff; color: #1D1D1F; border: 1px solid #D2D2D7; }
  .btn-default:hover { border-color: #007AFF; color: #007AFF; }
  body.brand-youxiaojiang .btn-default:hover { border-color: #E85D04; color: #E85D04; }
  .btn-success { background: #52c41a; color: #fff; }
  .btn-success:hover { background: #45a716; }

  /* 表格 */
  .table-wrap { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden; }
  table { width: 100%; border-collapse: collapse; }
  thead { background: #FAFAFA; }
  th { padding: 12px 16px; text-align: left; font-size: 13px; color: #666; font-weight: 600; border-bottom: 1px solid #F0F0F0; white-space: nowrap; }
  td { padding: 14px 16px; font-size: 14px; color: #333; border-bottom: 1px solid #F5F5F5; vertical-align: top; }
  tbody tr:hover { background: #FFFBF8; }
  tbody tr:last-child td { border-bottom: none; }

  /* 状态标签 */
  .badge {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 12px; font-weight: bold; white-space: nowrap;
  }
  .badge-pending { background: #FFF8E1; color: #F9A825; }
  .badge-confirmed { background: #E8EAF6; color: #3949AB; }
  .badge-delivering { background: #E0F2F1; color: #00796B; }
  .badge-delivered { background: #E8F5E9; color: #2E7D32; }
  .badge-cancelled { background: #FFEBEE; color: #C62828; }

  /* 操作按钮 */
  .action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
  .action-btn {
    padding: 4px 10px; border-radius: 4px; cursor: pointer;
    font-size: 12px; border: 1px solid; transition: all 0.2s;
  }
  .action-btn:hover { opacity: 0.8; }
  .btn-view { color: #1890ff; border-color: #1890ff; }
  .btn-confirm { color: #52c41a; border-color: #52c41a; }
  .btn-ship { color: #FA8C16; border-color: #FA8C16; }
  .btn-done { color: #722ED1; border-color: #722ED1; }

  /* 分页 */
  .pagination { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-top: 1px solid #F0F0F0; }
  .pagination-info { font-size: 13px; color: #999; }
  .pagination-btns { display: flex; gap: 6px; }
  .page-btn {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border: 1px solid #D9D9D9; border-radius: 4px; cursor: pointer; font-size: 13px;
    transition: all 0.2s;
  }
  .page-btn:hover, .page-btn.active { border-color: #E85D04; color: #E85D04; }

  /* 模态框 */
  .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
  .modal-overlay.show { display: flex; }
  .modal { background: #fff; border-radius: 12px; width: 600px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
  .modal-header { padding: 20px 24px; border-bottom: 1px solid #F0F0F0; display: flex; align-items: center; justify-content: space-between; }
  .modal-title { font-size: 16px; font-weight: bold; color: #1a1a2e; }
  .modal-close { cursor: pointer; font-size: 20px; color: #999; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
  .modal-close:hover { background: #F5F5F5; color: #333; }
  .modal-body { padding: 24px; }
  .modal-footer { padding: 16px 24px; border-top: 1px solid #F0F0F0; display: flex; gap: 10px; justify-content: flex-end; }

  .detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .detail-item { display: flex; flex-direction: column; gap: 4px; }
  .detail-label { font-size: 12px; color: #999; }
  .detail-value { font-size: 14px; color: #333; font-weight: 500; }
  .detail-full { grid-column: 1 / -1; }

  .items-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
  .items-table th { background: #FAFAFA; padding: 8px 12px; font-size: 12px; color: #666; text-align: left; }
  .items-table td { padding: 10px 12px; font-size: 13px; border-top: 1px solid #F0F0F0; }

  /* 消息通知 */
  .msg-list { display: flex; flex-direction: column; gap: 12px; }
  .msg-card { background: #fff; border-radius: 10px; padding: 16px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); display: flex; gap: 14px; }
  .msg-icon { font-size: 32px; flex-shrink: 0; }
  .msg-body { flex: 1; }
  .msg-title { font-size: 15px; font-weight: bold; color: #1a1a2e; }
  .msg-desc { font-size: 13px; color: #666; margin-top: 4px; line-height: 1.5; }
  .msg-time { font-size: 12px; color: #AAA; margin-top: 6px; }
  .msg-unread { width: 8px; height: 8px; background: #E85D04; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }

  /* 空态 */
  .empty-state { text-align: center; padding: 60px 0; color: #CCC; }
  .empty-state .icon { font-size: 60px; }
  .empty-state p { margin-top: 12px; font-size: 14px; }

  /* toast */
  #toast {
    position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.75); color: #fff; padding: 10px 20px;
    border-radius: 8px; font-size: 14px; z-index: 9999;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
    white-space: nowrap;
  }
  #toast.show { opacity: 1; }

  /* ── 产品表单样式 ── */
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-label { font-size: 13px; color: #555; font-weight: 500; }
  .form-label.req::before { content: '* '; color: #E85D04; }
  .form-ctrl {
    height: 36px; padding: 0 10px; border: 1px solid #D9D9D9; border-radius: 6px;
    font-size: 14px; color: #333; outline: none; transition: border-color .2s; width: 100%;
  }
  .form-ctrl:focus { border-color: #E85D04; box-shadow: 0 0 0 2px rgba(232,93,4,0.08); }
  textarea.form-ctrl { height: auto; padding: 8px 10px; }

  /* 动态行 */
  .dyn-row { display: grid; grid-template-columns: 1fr 32px; gap: 6px; align-items: center; }
  .dyn-row input { height: 32px; padding: 0 8px; border: 1px solid #E0E0E0; border-radius: 6px; font-size: 13px; outline: none; transition: border-color .2s; width: 100%; }
  .dyn-row input:focus { border-color: #E85D04; }
  .del-btn { width: 28px; height: 28px; border: none; background: #FFF0EE; color: #E85D04; border-radius: 6px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .del-btn:hover { background: #FFD5C8; }

  /* 规格行 */
  .spec-row { display: grid; grid-template-columns: 1fr 80px 32px; gap: 6px; align-items: center; padding: 6px 10px; border-top: 1px solid #F0F0F0; }
  .spec-row:first-child { border-top: none; }
  .spec-row input { height: 30px; padding: 0 8px; border: 1px solid #E0E0E0; border-radius: 5px; font-size: 13px; outline: none; transition: border-color .2s; width: 100%; }
  .spec-row input:focus { border-color: #E85D04; }

  /* Toggle 开关 */
  .toggle-wrap { position: relative; display: inline-block; width: 44px; height: 24px; }
  .toggle-wrap input { opacity: 0; width: 0; height: 0; }
  .toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #CCC; border-radius: 24px; transition: .3s; }
  .toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
  .toggle-wrap input:checked + .toggle-slider { background: #52c41a; }
  .toggle-wrap input:checked + .toggle-slider::before { transform: translateX(20px); }

  /* 产品卡片预览行 */
  .prod-preview { display: flex; align-items: center; gap: 10px; }
  .prod-emoji-badge { width: 36px; height: 36px; border-radius: 8px; background: #FFF0E5; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }

  @media (max-width: 900px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar { width: 60px; }
    .sidebar .logo-text, .sidebar .logo-sub, .nav-group-title, .nav-item span { display: none; }
    .main { margin-left: 60px; }
  }
