:root {
  --ink: #151c28;
  --sub: #6b7a90;
  --line: #e6eaf1;
  --bg: #f4f6fa;
  --primary: #1f4d8f;
  --primary-soft: #eef3fc;
  --accent: #d9551f;
  --green: #0e8763;
  --red: #c4442a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

#app { display: flex; min-height: 100vh; }

.side {
  width: 232px;
  background: #14213a;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex: none;
}

.brand {
  display: flex;
  gap: 12px;
  padding: 24px 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(140deg, #2a5fa8, #1f4d8f);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}

.brand-name { font-size: 15px; font-weight: 600; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.5); }

.nav { padding: 14px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: rgba(255,255,255,.72); cursor: pointer; font-size: 13.5px;
  margin-bottom: 4px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on { background: var(--primary); color: #fff; font-weight: 600; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); }
.nav-item.on .nav-dot { background: #ffd9a8; }

.side-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.who { font-size: 12px; color: rgba(255,255,255,.6); margin-bottom: 8px; }
.link-btn { background: none; border: none; color: #ffb070; font-size: 12px; cursor: pointer; padding: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 18px 28px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 600; }
.top-actions { display: flex; gap: 10px; align-items: center; }

.content { padding: 22px 28px 60px; }

.card {
  background: #fff; border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--line);
  overflow-x: auto;
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi-label { font-size: 12px; color: var(--sub); }
.kpi-num { font-size: 26px; font-weight: 600; color: var(--primary); margin-top: 6px; }
.kpi-num.warn { color: var(--accent); }
.kpi-note { font-size: 11px; color: var(--sub); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--sub); font-weight: 500; font-size: 12px; background: #fafbfd; }
tr:hover td { background: #fafbfd; }
td.num, th.num { text-align: right; }
td { word-break: break-word; }
.log-row td:first-child { white-space: nowrap; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; background: var(--primary-soft); color: var(--primary);
}
.tag.green { background: #e6f7f1; color: var(--green); }
.tag.orange { background: #fff0e9; color: var(--accent); }
.tag.grey { background: #f1f3f7; color: var(--sub); }
.tag.red { background: #fff1ef; color: var(--red); }

button { font-family: inherit; cursor: pointer; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
}
.btn:hover { border-color: #c9d8ee; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.ghost { background: #f7f9fc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font: inherit; font-size: 13px;
  background: #fff; color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #b9cdef; }
textarea { width: 100%; min-height: 120px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 5px; }
.form-row input, .form-row select { width: 100%; }

.modal {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0; background: rgba(14, 21, 32, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: #fff; border-radius: 14px; width: min(720px, 100%); max-height: 86vh;
  overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(10,20,35,.3);
}
.modal-box.wide { width: min(960px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.close-x { border: none; background: none; font-size: 20px; color: var(--sub); }

.chapter { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.chapter-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; background: #fafbfd; }
.chapter-head b { font-size: 13px; }
.lesson-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.lesson-row .l-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.log-row td { font-size: 12px; }
pre.json { background: #f7f9fc; border-radius: 8px; padding: 10px; font-size: 11.5px; overflow: auto; max-height: 160px; margin: 0; white-space: pre-wrap; max-width: 360px; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 10%, #22385c, #101a2b);
}
.login-card { width: 380px; background: #fff; border-radius: 16px; padding: 34px 32px; box-shadow: 0 30px 80px rgba(6,14,26,.45); }
.login-card h2 { margin: 0 0 6px; font-size: 20px; }
.login-card p { margin: 0 0 24px; font-size: 12.5px; color: var(--sub); }
.login-card input { width: 100%; margin-bottom: 12px; }
.login-err { color: var(--red); font-size: 12px; min-height: 18px; }

.trend { display: flex; align-items: flex-end; gap: 14px; height: 160px; margin-top: 10px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-bar { width: 26px; background: linear-gradient(180deg, #4c86d8, #1f4d8f); border-radius: 6px 6px 0 0; }
.trend-num { font-size: 11px; color: var(--sub); margin-bottom: 4px; }
.trend-date { font-size: 11px; color: var(--sub); margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: #14213a; color: #fff; padding: 10px 20px; border-radius: 20px;
  font-size: 13px; z-index: 200; box-shadow: 0 8px 30px rgba(10,20,35,.3);
}
.toast[hidden] { display: none; }

.empty { text-align: center; color: var(--sub); padding: 44px 0; font-size: 13px; }
.hint { font-size: 12px; color: var(--sub); }
.dot { color: #c5cdda; margin: 0 6px; }

/* AI新增：阿里云VOD / 直播 上传进度、复制行与提示条 */
.notice { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.notice.warn { background: #fff8e6; border: 1px solid #f2d691; color: #8a5a00; }
.progress { height: 8px; background: #eef1f6; border-radius: 6px; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #4c86d8, #1f4d8f); transition: width .2s ease; }
.copy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.copy-row code { background: #f1f4f9; border-radius: 6px; padding: 4px 10px; font-size: 12.5px; }
.copy-row input { flex: 1; min-width: 240px; }
