/* 主播业绩管理系统 —— 共享样式(苹果风格 · 移动端优先) */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #0071e3; --blue-h: #0077ed; --ink: #1d1d1f; --sub: #6e6e73;
  --line: #d2d2d7; --bg: #f5f5f7; --card: #ffffff;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }

/* 顶栏(毛玻璃) */
.topbar {
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.topbar .user { font-size: 13px; color: var(--sub); display: flex; gap: 10px; align-items: center; }
.topbar .user span { cursor: pointer; }
.topbar button {
  border: none; background: rgba(0,0,0,.04); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink);
}
.topbar button:active { background: rgba(0,0,0,.08); }

/* 页签 */
.tabs {
  display: flex; overflow-x: auto; background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 49px; z-index: 9; -webkit-overflow-scrolling: touch;
  padding: 6px 10px 0; gap: 4px;
}
.tabs button {
  flex: 0 0 auto; border: 1px solid transparent; background: transparent; padding: 9px 16px 11px;
  font-size: 14px; color: var(--sub); cursor: pointer; white-space: nowrap;
  border-radius: 9px 9px 0 0; border-bottom: 2px solid transparent;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tabs button:hover { background: rgba(255,255,255,.55); color: var(--blue); }
.tabs button.active {
  background: #fff; color: var(--blue); font-weight: 600;
  border: 1px solid var(--line); border-bottom: 2px solid #fff;
  border-radius: 9px 9px 0 0;
  box-shadow: 0 -2px 6px rgba(0,0,0,.05), 0 3px 6px rgba(0,0,0,.04);
  transform: translateY(-1px);
  position: relative;
}
.tab-badge {
  position: absolute; top: -5px; right: -7px; min-width: 18px; height: 18px;
  line-height: 18px; border-radius: 9px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; text-align: center; padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.35); display: none; z-index: 5;
}
.tabs button { position: relative; }
.tabs button.active::after {
  content: '';
  position: absolute; bottom: -2px; left: 14px; right: 14px; height: 2px;
  background: #8bc34a; border-radius: 2px;
}

.container { max-width: 760px; margin: 0 auto; padding: 14px 14px 70px; }
.card {
  background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.03);
}
.card h3 { font-size: 14px; margin-bottom: 12px; color: var(--ink); font-weight: 600; }

/* 表单:统一高度与圆角,label 上置 */
label { display: block; font-size: 12px; color: var(--sub); margin: 0 0 5px; font-weight: 500; }
input, select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--ink);
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 52px; padding: 9px 12px; }
/* 勾选框/单选框:不受全局 input 撑满样式影响(修复按间/休息日等 checkbox 变形不可选) */
input[type="checkbox"], input[type="radio"] {
  width: auto; height: auto; padding: 0; margin: 0 4px 0 0;
  border: none; border-radius: 0; vertical-align: middle;
  -webkit-appearance: checkbox; appearance: auto; box-shadow: none;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,.18);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

/* 行布局:统一 flex,移动端自动换行;所有格子等宽 */
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > div { flex: 1 1 150px; min-width: 0; }
.row > div > label { display: block; }

/* 按钮:胶囊 */
.btn {
  display: inline-block; border: none; border-radius: 999px; padding: 11px 16px;
  font-size: 15px; font-weight: 600; cursor: pointer; background: var(--blue); color: #fff;
  width: 100%; text-align: center; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--blue-h); }
.btn:active { transform: scale(.98); }
.btn.gray { background: #ffffff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn.gray:hover { background: #eef4ff; }
.btn.gray:active { background: #dbeafe; }
.btn.green { background: #34c759; }
.btn.green:hover { background: #2db64f; }
.btn.red { background: #ff3b30; }
.btn.red:hover { background: #e6352b; }
.btn.small { padding: 6px 12px; font-size: 13px; width: auto; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 表格:极简,横向滚动,首列左对齐 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 8px; text-align: right; border-bottom: 1px solid #f0f0f2; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--sub); font-weight: 500; font-size: 12px; background: #fafafc; }
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 100%; }

/* 翻页控件 */
.pg-row td { text-align: center; border-bottom: none; padding-top: 12px; }

/* KPI 卡片 */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: 14px; padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.kpi .num { font-size: 20px; font-weight: 700; margin-top: 2px; letter-spacing: -.3px; }
.kpi .lab { font-size: 12px; color: var(--sub); }
.kpi.accent { background: var(--blue); color: #fff; }
.kpi.accent .lab { color: rgba(255,255,255,.75); }
.kpi.warn { background: #fff6e5; }
.kpi.warn .num { color: #b45309; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.badge.pending { background: #fff3cd; color: #8a6d00; }
.badge.approved { background: #d8f5e3; color: #0a7a3d; }
.badge.rejected { background: #fde3e3; color: #c0392b; }
.badge.draft { background: #e8e8ed; color: #6e6e73; }
.badge.confirmed { background: #d8f5e3; color: #0a7a3d; }

/* 提示浮层 */
.msg { position: fixed; left: 50%; transform: translateX(-50%); top: 64px; z-index: 99;
  background: rgba(0,0,0,.85); color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 13px;
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; backdrop-filter: blur(8px); }
.msg.show { opacity: 1; }
.msg.err { background: #ff3b30; }

/* 登录 */
.login-wrap { max-width: 380px; margin: 70px auto; padding: 0 16px; }
.login-box { background: var(--card); border-radius: 20px; padding: 30px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,.1); }
.login-box h1 { font-size: 20px; margin-bottom: 4px; }
.login-box .sub { font-size: 13px; color: var(--sub); margin-bottom: 18px; }
.hint { font-size: 12px; color: #8e8e93; margin-top: 14px; line-height: 1.7; }

.empty { text-align: center; color: #8e8e93; padding: 26px 0; font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.neg { color: #ff3b30; }

.ptrack { background: #e8e8ed; border-radius: 999px; height: 10px; overflow: hidden; }
.pfill { background: var(--blue); height: 10px; border-radius: 999px; transition: width .3s; }
.pfill.done { background: #34c759; }
.plab { display: flex; justify-content: space-between; font-size: 13px; margin: 10px 0 4px; }
.plab b { color: var(--ink); }
.prate { font-size: 12px; color: var(--sub); margin-top: 3px; }
.donut-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 8px; }
.donut-card .lab { margin-top: 6px; font-size: 12px; color: #48484a; }
.dval { font-size: 12px; color: var(--ink); margin-top: 2px; font-weight: 600; }
.dsub { font-size: 11px; color: var(--sub); margin-top: 2px; }
.ov-flex { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.ov-flex > div { flex: 1 1 0; min-width: 200px; min-height: 250px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal { background: var(--card); border-radius: 18px; padding: 22px; width: min(92vw, 400px);
  max-height: 88vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal h3 { font-size: 17px; margin-bottom: 14px; }

/* 移动端响应 */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .container { padding: 12px 12px 60px; }
  .card { padding: 14px; border-radius: 14px; }
  .row { gap: 8px; }
  .row > div { flex: 1 1 100%; }   /* 手机端单列堆叠,避免框体变形错位 */
  .kpis { gap: 8px; }
  th, td { padding: 8px 6px; }
}
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
/* 档案标签:页名栏标签纸设计(五端共用) */
.brand-tab {
  display: inline-block;
  background: linear-gradient(180deg, #fdf6e3 0%, #f7e8c3 100%);
  color: #7a5c1e;
  font-size: 15px;
  font-weight: 700;
  padding: 5px 16px 8px;
  border-radius: 9px 9px 3px 3px;
  box-shadow: 0 2px 5px rgba(122, 92, 30, .20), inset 0 1px 0 rgba(255,255,255,.65);
  border: 1px solid #e5d3a0;
  border-top: 2px solid #f2e3bc;
  transform: translateY(-2px);
  position: relative;
}
.brand-tab::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: rgba(139, 195, 74, .35);
}

/* 页签角标(待办数) */
#tabs button .badge-dot, .tabs button .badge-dot {
  display: inline-block;
  background: #dc2626; color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 10px;
  padding: 0 6px; line-height: 16px;
  margin-left: 5px; vertical-align: 1px;
}

/* ---------- 移动端响应式(≤768px:手机免代理访问) ---------- */
@media (max-width: 768px) {
  .container { padding: 10px 8px; }
  .card { padding: 12px; margin-bottom: 12px; }
  .row { flex-direction: column; align-items: stretch !important; gap: 8px; }
  .row > div { width: 100% !important; }
  .row input, .row select { width: 100% !important; }
  /* 页签横向滚动,不换行挤压 */
  #tabs, .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
  #tabs button, .tabs button { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  /* 表格横向滚动(不挤压变形) */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 640px; }
  /* 弹窗占满宽度 */
  .modal-mask .modal { width: 96%; max-width: 96%; max-height: 88vh; overflow-y: auto; }
  /* KPI 卡片两列 */
  .kpis { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .kpi { padding: 10px; }
  /* 按钮行可换行 */
  .btn { padding: 10px 16px !important; }
  body { font-size: 14px; }
}
