/* 课程资产 · 样式（配色与「会员管家」黑金主题保持一致） */
:root {
  --bg: #0f1115;            /* bg-primary */
  --bg-2: #181b22;          /* bg-secondary */
  --bg-3: #10131a;          /* bg-input */
  --line: #2b2f38;          /* border-color */
  --ink: #f0ede4;           /* text-main */
  --ink-2: #9aa0ab;         /* text-muted */
  --ink-3: #6b717c;
  --gold: #d4af37;          /* primary-color */
  --gold-soft: rgba(212, 175, 55, 0.16); /* primary-light */
  --gold-dark: #b8962e;     /* primary-dark */
  --blue: #6aa3d8;
  --green: #4ade80;         /* ok */
  --green-soft: rgba(74, 222, 128, 0.12); /* ok-light */
  --red: #f87171;           /* danger */
  --red-soft: rgba(248, 113, 113, 0.14);  /* danger-light */
  --warn: #fb923c;
  --warn-soft: rgba(251, 146, 60, 0.14);
  --radius: 12px;           /* card-radius */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, #1a2030 0%, var(--bg) 70%);
  padding: 24px;
}
.login-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: .04em;
}
.login-card h1 .gold { color: var(--gold); }
.login-card .sub { color: var(--ink-3); font-size: 13.5px; margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--gold); }
.btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--gold);
  color: #171204;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--gold-dark); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-3); }
.msg-error {
  color: var(--red);
  font-size: 13.5px;
  margin-bottom: 14px;
  min-height: 18px;
}
.hint { color: var(--ink-3); font-size: 12.5px; margin-top: 18px; text-align: center; }

/* ---------- 应用骨架 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar .brand {
  padding: 0 22px 22px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .05em;
}
.sidebar .brand .gold { color: var(--gold); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 14.5px;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--gold-soft); color: var(--gold-dark); font-weight: 600; border-left-color: var(--gold); }
.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: #171204;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  padding: 1px 7px;
  border-radius: 100px;
}
.nav-badge.warn { background: var(--warn); color: #21140a; }
.main {
  flex: 1;
  padding: 28px 34px;
  overflow-x: hidden;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.topbar h2 { margin: 0; font-size: 22px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-2);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card h3 { margin: 0 0 12px; font-size: 16px; }
.muted { color: var(--ink-3); font-size: 13.5px; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}
.empty .big { font-size: 40px; margin-bottom: 12px; opacity: .5; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  width: 100%; max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { margin: 0 0 16px; font-size: 18px; }

.center { display:flex;align-items:center;justify-content:center;height:100vh;color:var(--ink-3); }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 18px;
}
.toolbar .search { flex: 1 1 200px; min-width: 160px; }
.toolbar input, .toolbar select {
  padding: 9px 12px; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-size: 14px; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.toolbar .spacer { flex: 1; }
.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle button {
  padding: 8px 14px; background: var(--bg-3); border: none; color: var(--ink-2);
  cursor: pointer; font-size: 13px;
}
.view-toggle button.active { background: var(--gold); color: #1a1408; }
.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.chk input { accent-color: var(--gold); }

/* ---------- 资产卡片网格 ---------- */
.asset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.asset-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; transition: border-color .15s;
}
.asset-card:hover { border-color: var(--gold); }
.asset-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.star { cursor: pointer; color: var(--ink-3); font-size: 16px; line-height: 1; }
.star.on { color: var(--gold); }
.asset-name { flex: 1; font-weight: 600; cursor: pointer; }
.asset-name:hover { color: var(--gold); }
.asset-type { font-size: 11.5px; color: var(--ink-3); background: var(--bg-3); padding: 2px 8px; border-radius: 100px; }
.asset-meta { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.asset-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 10px; }
.price { color: var(--ink); font-weight: 500; }
.exp { padding: 2px 8px; border-radius: 100px; font-size: 12px; }
.exp-ok { background: var(--green-soft); color: var(--green); }
.exp-soon { background: var(--warn-soft); color: var(--warn); }
.exp-expired { background: var(--red-soft); color: var(--red); }
.exp-perm { background: var(--bg-3); color: var(--ink-3); }
.asset-extra { font-size: 12px; margin-bottom: 8px; color: var(--ink-3); }
.asset-extra.warn { color: var(--warn); }
.asset-extra.exp-soon { color: var(--warn); }
.asset-extra.exp-expired { color: var(--red); }
.asset-actions { display: flex; gap: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 13px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------- 进度条 ---------- */
.progress-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.progress { flex: 1; height: 6px; background: var(--bg-3); border-radius: 100px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--gold); transition: width .2s; }
.progress-text { font-size: 12px; color: var(--ink-3); min-width: 34px; text-align: right; }

/* ---------- 今日提醒 ---------- */
.reminder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.reminder-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; transition: border-color .15s;
}
.reminder-card:hover { border-color: var(--gold); }
.reminder-label { color: var(--ink-2); font-size: 13px; }
.reminder-num { font-size: 30px; font-weight: 700; color: var(--gold); line-height: 1.3; }
.reminder-list { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; font-size: 12.5px; }
.reminder-item { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; color: var(--ink-2); }
.reminder-item:hover { color: var(--gold); }
.reminder-sub { margin-top: 8px; color: var(--ink-3); font-size: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.big-num { font-size: 32px; font-weight: 700; color: var(--gold); line-height: 1.3; }

/* ---------- 详情时间轴 / 提示 ---------- */
.timeline { border-left: 1px solid var(--line); padding-left: 14px; }
.timeline-item { position: relative; padding: 4px 0 10px; font-size: 13px; }
.timeline-item::before {
  content: ''; position: absolute; left: -19px; top: 9px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
}
.note { border-radius: 8px; padding: 12px 14px; font-size: 13.5px; margin: 14px 0; line-height: 1.7; }
.note.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(251,146,60,.35); }

/* ---------- 分组 ---------- */
.group { margin-bottom: 24px; }
.group-head { font-size: 15px; font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-size: 14px; outline: none; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field textarea { resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; }
.opts { display: flex; gap: 20px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.danger { color: var(--red); }

/* ---------- 详情 ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.detail-grid .k { display: inline-block; width: 90px; color: var(--ink-3); font-size: 13px; }
.detail-grid .v { color: var(--ink); }
.link-item { margin-bottom: 6px; }
h4 { font-size: 14px; margin: 14px 0 8px; }

/* ---------- 导入 / 导出 ---------- */
.tag {
  display: inline-block; padding: 1px 9px; border-radius: 100px;
  font-size: 12px; line-height: 1.8; white-space: nowrap;
}
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--red-soft); color: var(--red); }
.transfer-table { max-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.transfer-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.transfer-table th, .transfer-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.transfer-table th { position: sticky; top: 0; background: var(--bg-2); color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.transfer-table td .muted { font-size: 12px; margin-top: 2px; }

/* ---------- 课表 / 计划 ---------- */
.nav-badge.ok { background: var(--green); color: #f3f7f4; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.task-list { display: flex; flex-direction: column; }
.task-row {
  display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line);
  align-items: flex-start;
}
.task-row:last-child { border-bottom: none; }
.task-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-3); color: var(--green); cursor: pointer; flex-shrink: 0;
  font-size: 13px; line-height: 1; padding: 0;
}
.task-check.checked { border-color: var(--green); background: var(--green-soft); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.task-row.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-sub { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; align-items: center; }
.task-actions { display: flex; gap: 12px; flex-shrink: 0; }
.task-more { text-align: center; padding: 9px; color: var(--blue); cursor: pointer; font-size: 13px; }
.task-group { margin-bottom: 16px; }
.task-group:last-child { margin-bottom: 0; }
.task-group-head { font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid var(--line); margin-bottom: 2px; }

.schedule-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.schedule-side .card { padding: 16px 18px; margin-bottom: 14px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-col { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px; min-height: 240px; }
.week-col.today { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.week-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.week-head b { color: var(--ink); font-size: 14px; }
.task-mini {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 8px; margin-bottom: 6px; cursor: pointer; font-size: 12.5px;
}
.task-mini:hover { border-color: var(--gold); }
.task-mini.done { opacity: .55; }
.task-mini.done .task-mini-title { text-decoration: line-through; }
.task-mini.skipped { opacity: .4; }
.task-mini-title { font-weight: 600; margin-bottom: 2px; overflow-wrap: anywhere; }
.task-mini-sub { color: var(--ink-3); font-size: 11.5px; }
.week-empty { color: var(--ink-3); text-align: center; font-size: 12px; padding-top: 14px; }
.plan-mini { padding: 9px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.plan-mini:last-child { border-bottom: none; padding-bottom: 0; }
.plan-mini-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.plan-mini .progress { margin-bottom: 5px; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.plan-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.plan-card h3 { font-size: 16px; margin: 0; }
.plan-actions { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 14px; }
.asset-picker { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin-top: 8px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; font-size: 13.5px; }
.picker-item:hover { background: var(--bg-3); }
.picker-item .ellipsis { flex: 1; max-width: none; }
.picker-item .minutes {
  width: 130px; padding: 6px 8px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; color: var(--ink); font-size: 12.5px; flex-shrink: 0;
}
.plan-preview { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 14px; background: var(--bg-3); font-size: 13.5px; }
.plan-preview .note { margin: 10px 0; }
.preview-list {
  font-size: 12.5px; color: var(--ink-2); max-height: 170px; overflow: auto; margin-top: 8px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 14px;
}

/* ---------- 复盘日历 ---------- */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-head span { text-align: center; font-size: 12.5px; color: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 6px; min-height: 64px; cursor: pointer; font-size: 12px; position: relative;
}
.cal-cell:hover { border-color: var(--gold); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.is-today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft); }
.cal-cell.checkin { background: var(--green-soft); border-color: var(--green); }
.cal-cell.has-review:not(.checkin) { background: var(--gold-soft); border-color: var(--gold); }
.cal-day { font-weight: 600; font-size: 13px; }
.cal-mood { font-size: 16px; margin-top: 2px; }
.cal-done { position: absolute; bottom: 4px; right: 6px; font-size: 11px; color: var(--ink-3); }

.mood-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.mood-picker button {
  padding: 8px 16px; border: 1px solid var(--line); background: var(--bg-3);
  border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink-2);
}
.mood-picker button.active { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }

/* ---------- 统计 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.stat-card {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; text-align: center;
}
.stat-card.small { padding: 12px; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--ink); }
.stat-card.small .stat-num { font-size: 18px; }
.stat-label { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.bar-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 10px; font-size: 13px; }
.bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--bg-3); border-radius: 6px; height: 12px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--gold), var(--gold-2, #d7b878)); height: 100%; border-radius: 6px; }
.bar-val { text-align: right; color: var(--ink); font-weight: 600; }

.heatmap { display: grid; grid-template-columns: repeat(auto-fill, 14px); gap: 3px; margin-top: 8px; }
.heat-cell { width: 14px; height: 14px; border-radius: 3px; background: var(--bg-3); }
.heat-cell.lvl-1 { background: #cfe8d4; }
.heat-cell.lvl-2 { background: #8fc99a; }
.heat-cell.lvl-3 { background: #4f9d63; }
.heat-cell.lvl-4 { background: #2e6e42; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .brand { display: none; }
  .nav-item { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; padding: 8px 14px; }
  .nav-item.active { border-left: none; border-bottom-color: var(--gold); }
  .main { padding: 18px; }
  .schedule-layout { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
  .week-col { min-height: 0; }
  .plan-grid { grid-template-columns: 1fr; }
  .task-row { flex-wrap: wrap; }
  .task-actions { width: 100%; justify-content: flex-end; }
  .weekday-picker { gap: 10px; }
  .picker-item .minutes { width: 92px; }
  .bar-row { grid-template-columns: 100px 1fr 70px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
