:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8f959e;
  --line: #e5e6eb;
  --accent: #3370ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 600; font-size: 16px; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }

.page { max-width: 1400px; margin: 0 auto; padding: 20px 24px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }

/* filters */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; align-items: end; }
.filters .search { grid-column: span 2; }
.filters label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.filter-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 13px; }
.filter-actions .spacer { flex: 1; }

/* table */
.el-table .cell { line-height: 1.5; }
.el-table__row { cursor: pointer; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.empty { color: #c0c4cc; }
.pager { display: flex; justify-content: flex-end; margin-top: 16px; }

/* detail */
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-head h2 { margin: 0; font-size: 22px; }
.detail-head .spacer { flex: 1; }
.group-title { font-weight: 600; margin: 0 0 14px; font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 24px; }
.grid .wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field label .ro { margin-left: 6px; font-size: 11px; color: #c0c4cc; }
.field .val { min-height: 22px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.field.dirty label { color: var(--accent); }
.field .el-select, .field .el-date-editor, .field .el-input-number { width: 100%; }
.files { display: flex; flex-direction: column; gap: 4px; }
.files .file { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.files .size { color: var(--muted); font-size: 12px; }
.savebar { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  padding: 12px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -2px 8px rgba(0,0,0,.04); }
.savebar .hint { color: var(--muted); font-size: 13px; margin-right: auto; }
.warn { margin-bottom: 16px; }

@media (max-width: 700px) {
  .page { padding: 12px 16px 40px; }
  .topbar { padding: 0 16px; }
  .filters .search { grid-column: auto; }
}

/* progress */
.pchip { display: inline-block; padding: 0 6px; font-size: 12px; line-height: 20px; border-radius: 4px;
  background: #f2f3f5; color: #4e5969; white-space: nowrap; }
.progress-panel .pstats { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-bottom: 16px; font-size: 14px; }
.progress-panel .pstats span { color: var(--muted); font-size: 12px; margin-right: 8px; }
.progress-panel .pline { display: grid; grid-template-columns: 160px 1fr 160px; gap: 12px; align-items: center; margin-bottom: 10px; }
.progress-panel .pname { font-weight: 500; }
.progress-panel .pname small { margin-left: 6px; color: var(--muted); font-weight: normal; }
.progress-panel .pmeta { color: var(--muted); font-size: 12px; }
.progress-panel .ptable { margin-top: 12px; }
@media (max-width: 700px) {
  .progress-panel .pline { grid-template-columns: 1fr; gap: 4px; }
}

/* contract import */
.group-title .sub { margin-left: 8px; font-weight: normal; font-size: 12px; color: var(--muted); }
.upload-tip { padding: 8px 0; color: #4e5969; font-size: 14px; }
.upload-tip em { color: var(--accent); font-style: normal; }
.el-upload-dragger { padding: 20px; }
.contract-result { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.from-contract { margin-left: 6px; padding: 0 4px; font-size: 11px; line-height: 16px; border-radius: 3px;
  background: #e8f3ff; color: var(--accent); }
.with-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 42%); gap: 16px; align-items: start; }
.with-preview .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.preview { position: sticky; top: 72px; }
.preview iframe { width: 100%; height: calc(100vh - 200px); min-height: 480px; border: 1px solid var(--line); border-radius: 4px; }
@media (max-width: 1100px) {
  .with-preview { grid-template-columns: 1fr; }
  .preview { position: static; }
}
.contract-summary { margin-top: 8px; }
.pay-table { margin-top: 8px; }
.warn-text { color: #e6a23c; }
.doc-text { height: calc(100vh - 200px); min-height: 480px; overflow: auto; margin: 0; padding: 12px; white-space: pre-wrap;
  font: 13px/1.7 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #fafafa; border: 1px solid var(--line); border-radius: 4px; }
.opt-new { margin-left: 8px; color: var(--muted); font-size: 11px; }
.dialog-tip { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.cand { margin-top: 2px; color: var(--muted); font-size: 12px; }

/* lesson form */
.lesson-page { max-width: 900px; }
.lf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.lf-hint { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.lf-actions { display: flex; justify-content: flex-end; }

/* shareable summary card: fixed width so screenshots look the same everywhere */
.summary-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.summary-wrap .el-alert { max-width: 560px; }
.lesson-card { width: 420px; max-width: 100%; background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(31, 35, 41, .10); color: #1f2329; }
.lc-head { padding: 22px 24px 18px; background: linear-gradient(135deg, #3370ff, #5b8cff); color: #fff; }
.lc-kicker { font-size: 12px; letter-spacing: 2px; opacity: .85; }
.lc-name { margin-top: 6px; font-size: 24px; font-weight: 600; }
.lc-time { margin-top: 4px; font-size: 13px; opacity: .9; }
.lc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 24px; border-bottom: 1px solid #f0f1f3; }
.lc-meta span { display: block; font-size: 12px; color: #8f959e; margin-bottom: 2px; }
.lc-progress, .lc-section { padding: 14px 24px 0; }
.lc-label { font-size: 12px; color: #3370ff; font-weight: 600; margin-bottom: 6px; }
.lc-text { font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.lc-foot { margin-top: 18px; padding: 12px 24px; font-size: 12px; color: #8f959e; background: #f7f8fa; text-align: right; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (max-width: 700px) {
  .topbar .sub { display: none; }
}

/* navigation & accounts */
.topnav { display: flex; gap: 4px; margin-left: 16px; }
.topnav a { padding: 6px 12px; border-radius: 6px; font-size: 14px; color: #4e5969; cursor: pointer; }
.topnav a:hover { background: #f2f3f5; }
.topnav a.active { color: var(--accent); background: #e8f3ff; font-weight: 500; }
.who { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.auth-page { display: flex; justify-content: center; padding: 64px 16px; }
.auth-card { width: 380px; max-width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 28px 28px 20px; }
.auth-card h2 { margin: 0 0 16px; text-align: center; }
.auth-tip { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.lesson-detail { padding: 4px 48px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.lesson-detail p { margin: 4px 0; }
@media (max-width: 700px) {
  .topnav { margin-left: 4px; }
  .topnav a { padding: 6px 6px; }
  .who .el-tag { display: none; }
}

/* 课酬统计 */
.salary-summary { display: flex; flex-wrap: wrap; gap: 8px 36px; align-items: baseline; }
.salary-summary span { color: var(--muted); font-size: 12px; margin-right: 6px; }
.salary-summary b { font-size: 18px; }
.salary-summary small { margin-left: 6px; color: var(--muted); }
.salary-card .sc-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.sc-name { font-size: 18px; font-weight: 600; }
.sc-stats { color: #4e5969; }
.sc-fee { margin: 10px 0 14px; padding: 8px 12px; background: #fff7e8; border-radius: 6px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.sc-fee span { display: inline-block; margin-right: 10px; color: #d25f00; font-size: 12px; font-weight: 600; }
.sc-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 24px; margin-bottom: 8px; }
.sc-table td { padding: 3px 16px 3px 0; font-size: 14px; }
.sc-events { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
@media (max-width: 800px) { .sc-grid { grid-template-columns: 1fr; } }

/* settlement */
.pchip.settled { background: #e8ffea; color: #00a854; }
.sc-pending { margin: 4px 0 12px; padding: 10px 12px; border: 1px solid #ffd8a8; border-radius: 6px; background: #fffaf2; }
.sc-pending-head, .sc-pending-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-pending-head { margin-bottom: 6px; font-size: 12px; }
.sc-pending-row { padding: 4px 0; font-size: 14px; border-top: 1px dashed #ffe4c2; }
.sc-projects { margin: 4px 0 8px; }
.sc-settled { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0 0 12px; font-size: 14px; }
.svc-done { font-size: 13px; color: #00a854; }
