/* ============ 广告制作需求管理系统 · 红金 KPI 主题 ============ */
:root {
  --red: #E60012;
  --red-bright: #F5454F;
  --red-deep: #B3000E;
  --red-dark: #8F000E;
  --gold: #FFB020;
  --gold-light: #FFD06B;
  --gold-deep: #FF9E1B;
  --orange: #F87117;
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --text: #1F2329;
  --text-sub: #86909C;
  --line: #EEF0F3;
  --green: #52C41A;
  --blue: #2E6BE6;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(31, 41, 55, .06);
  --hero-grad: linear-gradient(120deg, #F11224 0%, #E60012 46%, #F87117 100%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration: none; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* ============ 顶栏 ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 54px; z-index: 100;
  background: linear-gradient(145deg, #F11224 0%, #D60012 55%, #A30010 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; box-shadow: 0 2px 12px rgba(143, 0, 14, .35);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #FFD06B, #FFB020); color: #8F000E;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
}
.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.topbar-nav { display: none; align-items: center; gap: 4px; }
.topbar-nav a {
  color: rgba(255,255,255,.85); padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.topbar-nav a:hover { background: rgba(255,255,255,.12); }
.topbar-nav a.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.topbar-user .user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.user-name { font-weight: 600; }
.user-role { background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.btn-logout { color: #fff; opacity: .85; border-left: 1px solid rgba(255,255,255,.35); padding-left: 10px; }

/* ============ 页面主体 ============ */
.page-body { padding: 68px 14px 76px; max-width: 1240px; margin: 0 auto; }

/* ============ 底部导航（手机） ============ */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; height: 58px; z-index: 100;
  background: #fff; display: flex; border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(31,41,55,.06);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #9AA3AF; font-size: 11px; position: relative;
}
.bn-item .bn-icon { font-size: 19px; line-height: 1; }
.bn-item.active { color: var(--red); font-weight: 600; }
.bn-item.active::after {
  content: ''; position: absolute; top: 0; left: 32%; right: 32%; height: 3px;
  background: var(--red); border-radius: 0 0 3px 3px;
}
.bn-badge {
  position: absolute; top: 4px; right: calc(50% - 22px); background: var(--red); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 8px; padding: 0 4px;
}

/* ============ Hero 横幅（电脑版看板） ============ */
.hero {
  display: none; /* 手机版默认隐藏，电脑版显示 */
  background: var(--hero-grad); border-radius: 16px; padding: 26px 28px;
  color: #fff; margin-bottom: 14px; position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(230, 0, 18, .28);
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px;
  background: rgba(255,255,255,.08); border-radius: 50%;
}
.hero-title { font-size: 14px; opacity: .9; margin-bottom: 4px; }
.hero-num { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.hero-num small { font-size: 20px; font-weight: 600; }
.hero-sub { font-size: 12px; opacity: .8; margin-top: 6px; }

/* ============ KPI 卡片 ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi-card {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--red), var(--orange));
}
.kpi-card.gold::before { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.kpi-label { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }
.kpi-num { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; }
.kpi-num.red { color: var(--red); }
.kpi-num.gold { color: var(--gold-deep); }
.kpi-num.green { color: var(--green); }
.kpi-extra { font-size: 12px; color: var(--text-sub); margin-top: 5px; }

/* ============ 卡片 / 列表 ============ */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow);
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--red); }
.list-item {
  display: block; padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  color: var(--text); transition: background .15s;
}
.list-item:active { background: #FAFBFC; }
.list-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.list-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: none; }
.list-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-item-title { font-weight: 600; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item-sub { font-size: 13px; color: var(--text-sub); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.empty { text-align: center; color: #B4BAC3; padding: 44px 0; font-size: 14px; }
.empty::before { content: '📄'; display: block; font-size: 40px; margin-bottom: 8px; opacity: .5; }

/* ============ 状态徽章 ============ */
.badge {
  display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 6px;
  background: #F0F1F3; color: #6B7280; white-space: nowrap; font-weight: 500;
}
.badge.red   { background: #FDEAEC; color: var(--red); }
.badge.blue  { background: #E8F0FE; color: var(--blue); }
.badge.green { background: #E8F7EC; color: #3F9E1F; }
.badge.orange{ background: #FFF6E5; color: #C8750A; }
.badge.purple{ background: #F3E8FD; color: #7C3AED; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px; border-radius: 10px; font-size: 15px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #F5454F, #E60012); color: #fff; width: 100%;
  font-weight: 600; box-shadow: 0 3px 10px rgba(230, 0, 18, .25);
}
.btn:active { transform: translateY(1px); opacity: .9; }
.btn.outline { background: #fff; color: var(--red); border: 1px solid var(--red); box-shadow: none; }
.btn.gray { background: #F0F1F3; color: #555; box-shadow: none; }
.btn.green { background: linear-gradient(135deg, #37C05C, #1FA13D); color: #fff; box-shadow: 0 3px 10px rgba(31,161,61,.25); }
.btn.gold { background: linear-gradient(135deg, #FFC53D, #FF9E1B); color: #6B3E00; box-shadow: 0 3px 10px rgba(255,158,27,.3); }
.btn-sm { width: auto; padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn:disabled { opacity: .5; }

/* ============ 表单 ============ */
.form-item { margin-bottom: 16px; }
.form-label { font-size: 14px; color: #4B5563; margin-bottom: 7px; display: block; font-weight: 500; }
.form-label .req { color: var(--red); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month],
select, textarea {
  width: 100%; padding: 12px 13px; border: 1px solid #DFE2E6; border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--text); transition: border .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(230,0,18,.08); }
input:disabled, select:disabled { background: #F4F5F7; color: #8A8F99; }
.form-tip { font-size: 12px; color: var(--text-sub); margin-top: 5px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-item { flex: 1; }
.section-label { font-size: 14px; font-weight: 700; color: var(--red); margin: 8px 0 14px; padding-left: 10px; border-left: 3px solid var(--red); }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed #F0F1F3; font-size: 14px; }
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--text-sub); flex-shrink: 0; }
.kv-val { font-weight: 500; text-align: right; color: var(--text); }

/* ============ 时间线 ============ */
.timeline { padding-left: 16px; border-left: 2px solid var(--line); }
.tl-item { position: relative; padding: 0 0 18px 14px; }
.tl-item::before {
  content: ''; position: absolute; left: -23px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #CBD2D9;
}
.tl-item.done::before { background: var(--green); }
.tl-item.current::before { background: var(--red); box-shadow: 0 0 0 4px rgba(230,0,18,.15); }
.tl-node { font-weight: 600; font-size: 14px; }
.tl-meta { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.tl-comment { font-size: 13px; color: #555; margin-top: 5px; background: #FAFBFC; padding: 8px 10px; border-radius: 8px; }

/* ============ 签名板 ============ */
.sign-box {
  border: 1.5px dashed #CBD2D9; border-radius: 12px; background: #fff;
  width: 100%; height: 200px; touch-action: none;
}
.sign-actions { display: flex; gap: 10px; margin-top: 10px; }

/* ============ 上传 ============ */
.upload-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-item { width: 92px; height: 92px; border-radius: 10px; overflow: hidden; position: relative; background: #F0F1F3; border: 1px solid var(--line); }
.upload-item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.upload-add {
  width: 92px; height: 92px; border: 1.5px dashed #CBD2D9; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: #9AA3AF; font-size: 30px;
  cursor: pointer; background: #fff;
}
.preview-img { width: 100%; border-radius: 10px; margin-top: 8px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.tbl th, .tbl td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { background: #FAFBFC; color: #555; font-weight: 600; white-space: nowrap; }
.tbl td .link { color: var(--red); margin-right: 8px; }

/* ============ 登录页 ============ */
.login-wrap { min-height: 100vh; background: var(--hero-grad); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: #fff; border-radius: 18px; padding: 30px; width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.login-logo { width: 58px; height: 58px; border-radius: 15px; background: linear-gradient(135deg,#FFD06B,#FFB020); color:#8F000E; display:flex; align-items:center; justify-content:center; font-size:26px; font-weight:800; margin:0 auto 12px; }
.login-title { font-size: 21px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-sub); font-size: 13px; margin-bottom: 26px; }

/* ============ 看板 ============ */
.filter-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-row select, .filter-row input { flex: 1; min-width: 110px; }
.chart-box { width: 100%; height: 280px; }
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.chart-grid .card { margin-bottom: 0; }

/* 预算进度条 */
.progress-track { height: 10px; border-radius: 5px; background: #F0F1F3; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #FF9E1B, #E60012); }
.budget-item { margin-bottom: 14px; }
.budget-item .budget-head { display: flex; justify-content: space-between; font-size: 13px; }
.budget-item .budget-nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* ============ 弹窗 ============ */
.mask { position: fixed; inset: 0; background: rgba(17,24,39,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dialog { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; }
.dialog-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; }

/* ============ toast ============ */
#toast {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%);
  background: rgba(17,24,39,.88); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 14px; z-index: 300; display: none; max-width: 84%; text-align: center;
}

/* 价格异常 */
.warn-box { background: #FFF6E5; color: #C8750A; padding: 11px 13px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; border: 1px solid #F5D78E; line-height: 1.6; }

/* ============ 电脑端大屏（两套看板分割点） ============ */
@media (min-width: 768px) {
  .page-body { padding: 76px 24px 40px; }
  .bottomnav { display: none; }
  .topbar-nav { display: flex; }
  .card { padding: 20px 24px; }
  .hero { display: block; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .chart-box { height: 300px; }
  .list-item-sub { gap: 6px 16px; }
  .btn { max-width: 400px; }
  .hero { padding: 34px 40px; }
  .hero-num { font-size: 52px; }
}
