/* 后台/登录页专用：顶栏、导航、账号菜单、页面容器、登录卡片（依赖 base.css） */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 12px 24px; color: #fff; background: #18212b; box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 190px; }
.brand .eyebrow { color: #93a4b3; font-size: 11px; letter-spacing: .1em; }
.brand strong { font-size: 16px; font-weight: 600; letter-spacing: .02em; }
.nav { display: flex; flex: 1; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 7px 12px; border-radius: 8px; color: #c3d0db; text-decoration: none; font-size: 13px; transition: background .15s ease, color .15s ease; }
.nav a:hover { background: #263541; color: #fff; }
.nav a.active { color: #fff; background: #2f4a66; font-weight: 600; box-shadow: inset 0 -2px 0 #70b4ff; }
.account { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #cbd7e1; }
.account .who { display: flex; flex-direction: column; line-height: 1.25; }
.account .who small { color: #93a4b3; font-size: 11px; }
.account form { margin: 0; }

.account-menu { position: relative; }
.account-menu > summary { display: flex; align-items: center; gap: 9px; padding: 6px 12px 6px 8px; border: 1px solid #3c4c5c; border-radius: 10px; color: #d7e2eb; cursor: pointer; list-style: none; font-size: 13px; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu[open] > summary, .account-menu > summary:hover { border-color: #8db8ee; background: #22303d; color: #fff; }
.account-menu .account-caret { color: #93a4b3; font-size: 10px; }
.account-menu-list { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; display: flex; min-width: 178px; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid #33424f; border-radius: 10px; background: #1e2833; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); animation: flash-in .12s ease-out; }
.account-menu-list a, .account-menu-list button { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 7px; color: #d7e2eb; background: transparent; text-align: left; text-decoration: none; font-size: 13px; }
.account-menu-list a:hover, .account-menu-list button:hover { background: #2c3b49; color: #fff; }
.account-menu-list form { margin: 0; }

.ghost { padding: 7px 11px; border: 1px solid #4c5c6b; border-radius: 7px; color: #d7e2eb; background: transparent; text-decoration: none; font-size: 12px; }
.ghost:hover { border-color: #8db8ee; color: #fff; }
.topbar-search { flex: 0 1 220px; margin-left: auto; }
.topbar-search input { width: 100%; padding: 7px 11px; border: 1px solid #38495a; border-radius: 8px; color: #eaf1f7; background: #223040; font-size: 13px; }
.topbar-search input::placeholder { color: #8697a6; }
.topbar-search input:focus { outline: none; border-color: #70b4ff; background: #1b2836; }
.page { max-width: 1320px; margin: 0 auto; padding: 24px 24px 64px; }

/* 面包屑：进到第二层以后随时知道自己在哪、怎么回去 */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-dark); text-decoration: underline; }
.crumbs .sep { color: #b9c4ce; }
.crumbs span:last-child { color: var(--ink); font-weight: 600; }

/* 页面标题区：标题 + 说明 + 右侧操作 */
.page-head .actions { align-items: center; }
.page-head .stat { min-width: 150px; padding: 10px 14px; }
.page-head .stat strong { font-size: 20px; }

/* 密钥/路径这类要念给别人的内容 */
.key-value { font-size: 20px; font-weight: 600; letter-spacing: 3px; }
.copy-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 数据页：来源列只显示名字，操作列不要换行 */
.source-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.source-cell .pill { margin-left: 6px; }
.delete-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.card table td .actions { align-items: center; flex-wrap: nowrap; }

/* 表格行里的危险操作收进小菜单：默认只看到一个「删除」，点开才出现确认 */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { cursor: pointer; list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { border-color: #f0b4ad; color: #b42318; background: #fdf3f2; }
.row-menu-body { position: absolute; right: 0; z-index: 20; width: 210px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(24, 33, 43, .16); text-align: left; }
.row-menu-body form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.row-menu-body .hint { display: flex; align-items: center; gap: 6px; }

/* 列表页的批量操作条 */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fb; }
.bulk-bar label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.bulk-bar select { min-width: 140px; }
.bulk-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* 窄屏上的筛选表单折叠标题 */
.filter-details > summary { display: flex; align-items: center; gap: 8px; padding: 2px 0 10px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 700; }
.filter-details > summary::-webkit-details-marker { display: none; }
.filter-details > summary::before { content: "▸"; color: #9aa7b3; font-size: 11px; }
.filter-details[open] > summary::before { content: "▾"; }
.filter-details > summary .summary-hint { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.filter-details[open] > summary { padding-bottom: 6px; }

/* 总览的「下一步」引导：一眼看出该做什么、点哪里，不用去翻说明 */
.next-card { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; align-items: center; border-color: #bcd8f6; background: linear-gradient(180deg, #f7fbff, #fff); }
.next-kicker { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 99px; color: #174ea6; background: #e3efff; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.next-lead strong { display: block; color: #16212b; font-size: 17px; line-height: 1.4; }
.next-lead p { margin: 6px 0 14px; color: #55636f; font-size: 13px; line-height: 1.6; }
.step-track { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.step-track li { display: flex; align-items: center; gap: 10px; color: #6b7885; font-size: 13px; }
.step-track .step-dot { flex: 0 0 auto; width: 22px; height: 22px; border: 1px solid #cfdae4; border-radius: 50%; color: #7d8a97; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.step-track li.done { color: #3d4a56; }
.step-track li.done .step-dot { border-color: #b7e4d0; color: #0f6848; background: #e8f8f1; }
.step-track li.current { color: var(--ink); font-weight: 650; }
.step-track li.current .step-dot { border-color: var(--accent); color: #fff; background: var(--accent); }
.step-track .step-text { min-width: 0; }
.step-track .step-redo { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.step-track .step-redo:hover { color: var(--accent-dark); }
/* 班级页顶部的一行流程：横着排，当前这一步高亮 */
.class-flow { grid-auto-flow: column; grid-auto-columns: max-content; align-items: center; gap: 0; overflow-x: auto; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.class-flow li { gap: 7px; padding-right: 8px; }
.class-flow li + li::before { margin: 0 8px 0 2px; color: #c3ced8; content: '→'; }
.class-flow .step-dot { width: 18px; height: 18px; line-height: 16px; font-size: 10px; }

/* 缩略图：列表和对照页都用它，别直接加载几 MB 的原图 */
img.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #eef2f5; }
.record-photo { max-width: 100%; max-height: 320px; border: 1px solid var(--line); border-radius: 12px; object-fit: contain; background: #f7f9fb; }
.record-photo-wrap { text-align: center; }
.no-photo { padding: 22px; border: 1px dashed #c3ceda; border-radius: 12px; color: var(--muted); font-size: 13px; text-align: center; background: #f8fafc; }
/* 登录页 */
.auth-page { display: flex; min-height: 100vh; min-height: 100dvh; align-items: center; justify-content: center; padding: 24px 16px; background: #f3f5f4; }
.auth-card { width: 100%; max-width: 420px; padding: 30px 28px; border: 1px solid #dce2df; border-radius: 8px; background: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, .06); overflow-wrap: anywhere; }
.auth-card .eyebrow { color: #52685d; font-size: 14px; font-weight: 600; letter-spacing: 0; }
.auth-card h1 { margin-bottom: 4px; font-size: 24px; line-height: 1.4; letter-spacing: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #46525e; font-weight: 600; }
.auth-card input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
.auth-card input[type="email"] { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); }
.auth-card .button { width: 100%; padding: 11px; }
.auth-footer { margin: 20px 0 0; font-size: 14px; }
@media (max-width: 400px) { .auth-card { padding: 24px 20px; } }
@media (max-height: 700px) { .auth-page { align-items: flex-start; } }
.demo-panel { margin-top: 16px; padding: 12px 14px; border: 1px dashed #c3ceda; border-radius: 10px; background: #f8fafc; }
.demo-panel .demo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #46525e; font-size: 13px; }
.demo-panel label { display: flex; flex-direction: column; gap: 6px; color: #46525e; font-size: 13px; font-weight: 600; }
.demo-panel select { width: 100%; }
.demo-panel .hint { margin: 8px 0 0; }

/* 窄屏（手机/平板）：表格变卡片，一行一张，不用左右拖 */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .brand { flex: 1 1 auto; }
  .account { order: 1; margin-left: auto; }
  .topbar-search { order: 2; flex: 1 1 100%; margin-left: 0; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav a { flex: 0 0 auto; padding: 6px 10px; }
  .page { padding: 14px 14px 48px; }
  .grid-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .next-card { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 14px; }
  .card header { flex-wrap: wrap; }
  .card .actions { flex-wrap: wrap; }
  .inline { flex-direction: column; align-items: stretch; }
  /* 表单字段常带 style="flex:1 1 240px"；竖排时这个 flex-basis 会变成高度，撑出一大片空白 */
  .inline > * { flex: 0 0 auto !important; }
  .inline .field, .inline input, .inline select, .inline textarea { width: 100%; }
  .table-wrap { overflow-x: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .table-wrap tr:hover { background: #fff; }
  .table-wrap td { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 4px 0; border: 0; align-items: center; }
  .table-wrap td::before { content: attr(data-label); flex: 0 0 84px; color: var(--muted); font-size: 12px; font-weight: 600; }
  .table-wrap td > * { min-width: 0; }
  .table-wrap td .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .table-wrap td .actions { width: 100%; }
  .table-wrap td:first-child::before { content: none; }
  .table-wrap td:empty { display: none; }
  .table-wrap td .actions { flex-wrap: wrap; }
  .table-wrap .source-cell { max-width: none; }
  .page-head .actions { width: 100%; }
  /* 日志这类「一行好几列、行又多」的列表，窄屏横排成一两行，不做成三行卡片 */
  .table-wrap table.list-mobile tr { padding: 9px 11px; }
  .table-wrap table.list-mobile td { display: inline; padding: 0; }
  .table-wrap table.list-mobile td::before { content: none; }
  .table-wrap table.list-mobile td + td::before { content: ' · '; color: #b9c4ce; }
  .table-wrap table.list-mobile td:empty { display: none; }
  /* 吸底操作条在窄屏不能靠负外边距撑满，会把页面顶出横向滚动 */
  .sticky-actions { margin: 4px -14px -14px; padding: 12px 14px; }
  .sticky-actions .button { flex: 1 1 auto; text-align: center; }
}
