/* ============================================================
   管理后台 · 全新设计系统（小白友好）
   原则：大字大按钮 / 白话 / 一屏一件事 / 手机优先 / 轻量流畅
   ============================================================ */
:root {
  --a-bg: #f4f6fb;
  --a-card: #ffffff;
  --a-line: #e8ecf4;
  --a-text: #1c2333;
  --a-sub: #6b7488;
  --a-mut: #9aa3b8;
  --a-brand: #4f6ef7;
  --a-brand2: #7c5cf7;
  --a-grad: linear-gradient(120deg, #4f6ef7, #7c5cf7);
  --a-green: #16a34a;
  --a-red: #ef4444;
  --a-orange: #f97316;
  --a-r: 16px;
  --a-sh: 0 2px 10px rgba(28, 35, 51, .05);
  --a-sh2: 0 8px 28px rgba(28, 35, 51, .1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--a-bg); color: var(--a-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ================= 布局骨架 ================= */
.a-top {
  position: sticky; top: 0; z-index: 60;
  background: #fff; border-bottom: 1px solid var(--a-line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 60px;
}
.a-top-title { font-size: 19px; font-weight: 700; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-top-back {
  width: 40px; height: 40px; margin-left: -8px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--a-sub); flex-shrink: 0;
}
.a-top-back:active { background: var(--a-bg); }
.a-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.a-user {
  font-size: 13px; color: var(--a-sub); background: var(--a-bg);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.a-content { padding: 16px 16px 100px; max-width: 1080px; margin: 0 auto; }

/* 侧栏（桌面） */
.a-side { display: none; }

/* 手机底部标签栏 */
.a-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: #fff; border-top: 1px solid var(--a-line);
  display: flex; padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 14px rgba(28, 35, 51, .06);
}
.a-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 7px; color: var(--a-mut); font-size: 11px;
}
.a-tabbar .t-ico { font-size: 21px; line-height: 1.15; }
.a-tabbar a.on { color: var(--a-brand); font-weight: 700; }

/* ================= 卡片 ================= */
.a-card {
  background: var(--a-card); border-radius: var(--a-r);
  box-shadow: var(--a-sh); padding: 18px; margin-bottom: 16px;
}
.a-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.a-card-head h3 { font-size: 16.5px; font-weight: 700; }
.a-card-head .a-sub { font-size: 13px; color: var(--a-mut); font-weight: 400; }
.a-card-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* 大动作卡（工作台） */
.a-actions { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
.a-action {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: var(--a-r); padding: 18px;
  box-shadow: var(--a-sh); transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
}
.a-action:active { transform: scale(.985); }
.a-action-ico {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 27px;
  background: var(--a-bg);
}
.a-action-name { font-size: 17px; font-weight: 700; }
.a-action-desc { font-size: 13px; color: var(--a-sub); margin-top: 2px; }
.a-action-go { margin-left: auto; color: var(--a-mut); font-size: 20px; flex-shrink: 0; }
.a-action-main {
  background: var(--a-grad); color: #fff; border: none;
  box-shadow: 0 10px 26px rgba(79, 110, 247, .32);
}
.a-action-main .a-action-name { color: #fff; font-size: 19px; }
.a-action-main .a-action-desc { color: rgba(255, 255, 255, .88); }
.a-action-main .a-action-ico { background: rgba(255, 255, 255, .2); }
.a-action-main .a-action-go { color: rgba(255, 255, 255, .9); }

/* 数据小卡 */
.a-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.a-stat {
  background: #fff; border-radius: var(--a-r); padding: 16px;
  box-shadow: var(--a-sh); text-align: center;
}
.a-stat-num { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.a-stat-label { font-size: 12.5px; color: var(--a-mut); margin-top: 2px; }
.a-stat-ico { font-size: 20px; margin-bottom: 4px; }

/* ================= 表单（大字大框） ================= */
.a-field { display: block; margin-bottom: 20px; }
.a-field > span {
  display: block; font-size: 15.5px; font-weight: 700; margin-bottom: 8px;
}
.a-field > span .a-req { color: var(--a-red); }
.a-field > .a-hint {
  font-size: 13px; color: var(--a-mut); margin: -4px 0 8px; line-height: 1.6;
}
.a-input {
  width: 100%; height: 52px; border-radius: 14px;
  border: 2px solid var(--a-line); background: #fbfcfe;
  padding: 0 16px; font-size: 16px; color: var(--a-text);
  outline: none; transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
textarea.a-input { height: auto; padding: 14px 16px; line-height: 1.7; resize: vertical; }
select.a-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7488' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  padding-right: 44px;
}
.a-input:focus { border-color: var(--a-brand); background: #fff; }
.a-input::placeholder { color: #b6bdcf; }

/* 开关行 */
.a-switch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px; background: #fbfcfe;
  border: 2px solid var(--a-line); margin-bottom: 12px;
}
.a-switch-row .sw-txt { flex: 1; }
.a-switch-row .sw-name { font-size: 15.5px; font-weight: 700; }
.a-switch-row .sw-desc { font-size: 12.5px; color: var(--a-mut); margin-top: 1px; }
.a-switch {
  position: relative; width: 56px; height: 32px; flex-shrink: 0;
  border-radius: 999px; background: #dfe4ef; transition: background .2s;
}
.a-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18); transition: transform .2s;
}
.a-switch.on { background: var(--a-green); }
.a-switch.on::after { transform: translateX(24px); }
.a-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

/* 单选卡片组 */
.a-radios { display: flex; flex-direction: column; gap: 10px; }
.a-radio {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 14px; background: #fbfcfe;
  border: 2px solid var(--a-line); transition: all .15s;
}
.a-radio.on { border-color: var(--a-brand); background: rgba(79, 110, 247, .05); }
.a-radio input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--a-brand); flex-shrink: 0; }
.a-radio-name { font-size: 15.5px; font-weight: 700; }
.a-radio-desc { font-size: 12.5px; color: var(--a-mut); }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 22px; border-radius: 14px;
  font-size: 15.5px; font-weight: 600; white-space: nowrap;
  transition: transform .12s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--a-grad); color: #fff; box-shadow: 0 6px 18px rgba(79, 110, 247, .28); }
.btn-green { background: linear-gradient(120deg, #16a34a, #0ea5e9); color: #fff; box-shadow: 0 6px 18px rgba(22, 163, 74, .28); }
.btn-ghost { background: #fff; border: 2px solid var(--a-line); color: var(--a-text); }
.btn-danger { background: var(--a-red); color: #fff; }
.btn-danger-ghost { background: #fff; border: 2px solid #ffd9d9; color: var(--a-red); }
.btn-block { width: 100%; }
.btn-lg { height: 56px; font-size: 17px; border-radius: 16px; }
.btn-xl { height: 60px; font-size: 18px; border-radius: 18px; font-weight: 700; }
.btn-mini { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }

/* 底部固定保存栏（表单页） */
.a-savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 65;
  background: #fff; border-top: 1px solid var(--a-line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 10px; box-shadow: 0 -4px 20px rgba(28, 35, 51, .07);
}
.a-savebar .btn { flex: 1; }

/* ================= 列表（卡片式） ================= */
.a-list { display: flex; flex-direction: column; gap: 12px; }
.a-item {
  display: flex; gap: 14px; align-items: center;
  background: #fff; border-radius: var(--a-r); padding: 14px;
  box-shadow: var(--a-sh);
}
.a-item-img {
  width: 64px; height: 92px; flex-shrink: 0; border-radius: 12px;
  overflow: hidden; background: var(--a-bg);
}
.a-item-img.sq { height: 64px; }
.a-item-img img { width: 100%; height: 100%; object-fit: cover; }
.a-item-body { flex: 1; min-width: 0; }
.a-item-name { font-size: 16px; font-weight: 700; line-height: 1.4; }
.a-item-meta { font-size: 12.5px; color: var(--a-mut); margin-top: 3px; }
.a-item-acts { display: flex; gap: 8px; margin-top: 10px; }
.a-badge {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
}
.a-badge-hot { background: #fff1e8; color: #ea580c; }
.a-badge-mut { background: var(--a-bg); color: var(--a-mut); }
.a-empty { text-align: center; padding: 46px 16px; color: var(--a-mut); }
.a-empty .big { font-size: 40px; margin-bottom: 10px; }

/* 搜索框 */
.a-search { position: relative; margin-bottom: 14px; }
.a-search input { padding-left: 44px; }
.a-search .ico {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--a-mut); pointer-events: none;
}

/* 表格（桌面） */
.a-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.a-table th {
  text-align: left; font-size: 13px; color: var(--a-mut); font-weight: 600;
  padding: 0 12px 10px; border-bottom: 1px solid var(--a-line);
}
.a-table td { padding: 12px; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
.a-table tr:last-child td { border-bottom: none; }
.a-thumb { width: 40px; height: 56px; border-radius: 8px; object-fit: cover; }
.a-thumb.sq { width: 44px; height: 44px; border-radius: 10px; }

/* ================= 图片上传 ================= */
.a-upload {
  border: 2px dashed #cfd6e6; border-radius: var(--a-r);
  padding: 18px; text-align: center; background: #fbfcfe;
}
.a-upload.has-img { border-style: solid; border-color: var(--a-line); background: #fff; }
.a-upload-preview {
  width: 132px; margin: 0 auto 12px; border-radius: 12px; overflow: hidden;
  background: var(--a-bg); aspect-ratio: 2 / 3;
}
.a-upload-preview.sq { width: 132px; aspect-ratio: 1 / 1; }
.a-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.a-upload-tip { font-size: 12.5px; color: var(--a-mut); margin-top: 10px; }

/* ================= 提示条 / Toast ================= */
.a-alert {
  border-radius: 14px; padding: 14px 16px; margin-bottom: 16px;
  font-size: 15px; font-weight: 600; display: flex; gap: 8px; align-items: center;
}
.a-alert-ok { background: #e9f9ef; color: #15803d; }
.a-alert-err { background: #fdecec; color: #b91c1c; }
.a-toast {
  position: fixed; left: 50%; top: 20px; transform: translate(-50%, -16px);
  background: #1c2333; color: #fff; padding: 13px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; z-index: 200; opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22); max-width: 88vw; text-align: center;
}
.a-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 弹窗（删除确认） */
.a-modal {
  position: fixed; inset: 0; z-index: 300; background: rgba(20, 26, 40, .5);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.a-modal.on { display: flex; }
.a-modal-card {
  background: #fff; border-radius: 20px; padding: 24px;
  width: 100%; max-width: 340px; text-align: center;
  animation: aPop .2s ease;
}
@keyframes aPop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.a-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.a-modal-body { font-size: 15px; color: var(--a-sub); margin-bottom: 20px; line-height: 1.6; }
.a-modal-actions { display: flex; gap: 10px; }
.a-modal-actions .btn { flex: 1; }

/* ================= 登录页 ================= */
.a-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #eef1fb 0%, #e6ecfb 50%, #f4f0fd 100%);
}
.a-login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 24px;
  padding: 32px 24px; box-shadow: 0 20px 60px rgba(28, 35, 51, .12);
}
.a-login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.a-login-ico {
  width: 54px; height: 54px; border-radius: 16px; flex-shrink: 0;
  background: var(--a-grad); display: flex; align-items: center;
  justify-content: center; font-size: 27px;
  box-shadow: 0 10px 24px rgba(79, 110, 247, .3);
}
.a-login-name { font-size: 19px; font-weight: 800; }
.a-login-sub { font-size: 13px; color: var(--a-mut); }
.a-login-foot { font-size: 12.5px; color: var(--a-mut); text-align: center; margin-top: 18px; line-height: 1.7; }

/* ================= 教程页 ================= */
.a-guide-step {
  display: flex; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--a-line);
}
.a-guide-step:last-child { border-bottom: none; }
.a-guide-num {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  background: var(--a-grad); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.a-guide-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.a-guide-text { font-size: 14.5px; color: var(--a-sub); line-height: 1.8; }
.a-guide-text b { color: var(--a-text); }
.a-kbd {
  display: inline-block; background: var(--a-bg); border: 1px solid var(--a-line);
  border-radius: 7px; padding: 1px 8px; font-size: 13px; font-weight: 600; color: var(--a-brand);
}

/* ================= 选集行 ================= */
.a-ep-row {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px;
}
.a-ep-row .a-input { height: 48px; font-size: 15px; }
.a-ep-row .ep-name { width: 108px; flex-shrink: 0; text-align: center; }
.a-ep-row .ep-del { width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px;
  background: #fff; border: 2px solid #ffd9d9; color: var(--a-red); font-size: 17px; }

/* ================= 桌面端 ================= */
@media (min-width: 768px) {
  .a-tabbar { display: none; }
  .a-top { display: none; }
  body { display: flex; min-height: 100vh; }
  .a-side {
    display: flex; flex-direction: column; width: 236px; flex-shrink: 0;
    background: #fff; border-right: 1px solid var(--a-line);
    padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  }
  .a-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; }
  .a-brand-ico {
    width: 42px; height: 42px; border-radius: 13px; background: var(--a-grad);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; flex-shrink: 0;
  }
  .a-brand-txt { font-size: 15.5px; font-weight: 800; line-height: 1.3; }
  .a-brand-txt small { display: block; font-size: 11.5px; color: var(--a-mut); font-weight: 500; }
  .a-menu { display: flex; flex-direction: column; gap: 4px; }
  .a-menu a {
    display: flex; align-items: center; gap: 11px; padding: 12px 14px;
    border-radius: 12px; font-size: 15.5px; font-weight: 600; color: var(--a-sub);
    transition: background .15s, color .15s;
  }
  .a-menu a:hover { background: var(--a-bg); color: var(--a-text); }
  .a-menu a.on { background: rgba(79, 110, 247, .09); color: var(--a-brand); }
  .a-menu .m-ico { font-size: 18px; width: 22px; text-align: center; }
  .a-menu-sep { height: 1px; background: var(--a-line); margin: 10px 8px; }
  .a-side-foot { margin-top: auto; font-size: 12px; color: var(--a-mut); padding: 0 8px; }
  .a-main-col { flex: 1; min-width: 0; }
  .a-content { padding: 28px 32px 60px; max-width: 1080px; }
  .a-actions { grid-template-columns: repeat(2, 1fr); }
  .a-stats { grid-template-columns: repeat(4, 1fr); }
  .a-savebar {
    position: static; border: none; box-shadow: none; padding: 0;
    margin-top: 8px; max-width: 460px;
  }
  .a-list-desk { display: block; }
  .a-list { display: none; }
  .a-item-acts { margin-top: 8px; }
}

/* 小屏列表（默认手机） */
@media (min-width: 768px) { .a-only-mobile { display: none !important; } }
@media (max-width: 767px) { .a-only-desk { display: none !important; } }

/* 表单页：隐藏底部标签栏，保存栏独占底部（避免遮挡） */
body.no-tabbar .a-tabbar { display: none; }
body.no-tabbar .a-savebar { bottom: 0; }
body.no-tabbar .a-content { padding-bottom: 130px; }
@media (min-width: 768px) {
  body.no-tabbar .a-content { padding-bottom: 60px; }
}

/* 列表卡片更紧凑（一屏看更多） */
.a-item-img { width: 56px; height: 80px; }
.a-item-img.sq { height: 56px; }
.a-item-name { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-item-acts { gap: 10px; }
