* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6f8; color: #1f2937; font-size: 14px; }
a { color: #0e7490; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f766e, #155e75); }
.login-card { width: 360px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p.sub { color: #6b7280; margin: 0 0 20px; font-size: 13px; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #0f172a; color: #cbd5e1; padding: 18px 0; flex-shrink: 0; }
.sidebar .brand { font-size: 16px; color: #fff; padding: 0 20px 16px; font-weight: 600; }
.sidebar .brand small { display: block; color: #64748b; font-weight: 400; font-size: 12px; margin-top: 4px; }
.nav-item { padding: 11px 20px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; }
.nav-item:hover { background: #1e293b; color: #fff; }
.nav-item.active { background: #0e7490; color: #fff; }
.nav-item .badge { background: #ef4444; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; line-height: 18px; height: 18px; }
.main { flex: 1; padding: 22px 26px; overflow: auto; }
.main h2 { margin: 0 0 16px; font-size: 19px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
input, select, textarea { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: #14b8a6; }
button { padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; background: #0e7490; color: #fff; cursor: pointer; font-size: 14px; }
button:hover { opacity: .9; }
button.ghost { background: #fff; color: #0f766e; border-color: #99f6e4; }
button.danger { background: #dc2626; }
button.warn { background: #d97706; }
button.small { padding: 5px 10px; font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card .num { font-size: 26px; font-weight: 700; color: #0f766e; }
.card .label { color: #6b7280; font-size: 13px; margin-top: 4px; }
.panel { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eef2f6; vertical-align: top; font-size: 13px; }
th { color: #6b7280; font-weight: 500; background: #f9fafb; }
tr:hover td { background: #fbfdfe; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #e5e7eb; color: #374151; }
.tag.pending { background: #fef3c7; color: #92400e; }
.tag.approved { background: #d1fae5; color: #065f46; }
.tag.rejected, .tag.offline, .tag.banned { background: #fee2e2; color: #991b1b; }
.tag.user { background: #dbeafe; color: #1e40af; }
.tag.admin { background: #ede9fe; color: #5b21b6; }
.thumb { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; background: #eef2f6; }
.muted { color: #9ca3af; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: #dc2626; }
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: 640px; max-height: 86vh; overflow: auto; }
.modal h3 { margin-top: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.field { margin-bottom: 12px; }
.field label { display: block; color: #6b7280; font-size: 12px; margin-bottom: 4px; }
img.preview { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; }
.empty { padding: 30px; text-align: center; color: #9ca3af; }
.bar { height: 8px; background: #14b8a6; border-radius: 4px; }

/* 表格容器：窄屏时横向兜底，避免撑破布局 */
.table-wrap { width: 100%; }

/* 手机端顶部条与抽屉遮罩：桌面端一律隐藏 */
.mobile-bar, .menu-mask { display: none; }

/* ==================== 手机端适配（≤900px） ==================== */
@media (max-width: 900px) {
  body { font-size: 15px; }

  /* 侧栏改为抽屉，从左侧滑出 */
  .layout { display: block; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 246px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .22s ease;
    overflow-y: auto;
    padding-top: 14px;
    box-shadow: 4px 0 24px rgba(15, 23, 42, .3);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-item { padding: 15px 20px; font-size: 15px; }
  .brand { padding: 0 20px 18px; }

  .menu-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 55;
  }
  .menu-mask.show { opacity: 1; pointer-events: auto; }

  /* 顶部条 */
  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    height: 54px;
    padding: 0 14px;
    background: #0f172a;
    color: #fff;
    z-index: 40;
  }
  .mb-btn {
    font-size: 22px;
    line-height: 1;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
  }
  .mb-btn:active { background: #1e293b; }
  .mb-title { flex: 1; font-size: 16px; font-weight: 600; }

  .main { padding: 16px 14px 40px; }
  .main h2 { font-size: 18px; margin-bottom: 14px; }

  /* 表单与按钮：加大点按区域，方便手指操作 */
  input, select, textarea { font-size: 16px; padding: 11px 12px; }
  button { padding: 11px 16px; font-size: 15px; min-height: 44px; }
  button.small { padding: 9px 13px; font-size: 14px; min-height: 38px; }
  .toolbar { gap: 8px; }
  .toolbar input, .toolbar select { width: 100% !important; }
  .toolbar button { flex: 1; }

  /* 统计卡片两列 */
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 14px; }
  .card .num { font-size: 23px; }

  /* 表格改为卡片列表：每行一张卡，字段带标签 */
  .table-wrap { overflow: visible; }
  .resp-table { display: block; border-collapse: separate; }
  .resp-table thead { display: none; }
  .resp-table tbody, .resp-table tr, .resp-table td { display: block; width: 100%; }
  .resp-table tr {
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
    border: 1px solid #eef2f6;
  }
  .resp-table tr:hover td { background: transparent; }
  .resp-table td {
    border: none;
    padding: 5px 0;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
  }
  .resp-table td::before {
    content: attr(data-label);
    flex: none;
    width: 78px;
    color: #9ca3af;
    font-size: 13px;
    padding-top: 1px;
  }
  /* 无标签的单元格：封面缩略图与操作按钮区 */
  .resp-table td.cell-cover,
  .resp-table td.cell-actions,
  .resp-table td.empty { display: block; }
  .resp-table td.cell-cover::before,
  .resp-table td.cell-actions::before { display: none; }
  .resp-table td.cell-cover { padding-bottom: 10px; }
  .resp-table td.cell-main::before { display: none; }
  .resp-table td.cell-main { padding-bottom: 8px; font-size: 15px; }
  .resp-table td.cell-actions {
    border-top: 1px solid #f1f5f9;
    margin-top: 8px;
    padding-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .resp-table .thumb { width: 84px; height: 84px; }
  .resp-table td.empty { text-align: center; color: #9ca3af; }

  /* 分页 */
  .pager { justify-content: space-between; }
  .pager span { font-size: 13px; }

  /* 弹窗铺满，方便在手机上查看与操作 */
  .modal {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 16px;
  }
  .modal-mask { align-items: stretch; }
  .modal .row > input { flex: 1 1 100%; }
  .modal .row > button { flex: 1; }
  img.preview { width: 88px; height: 88px; }

  /* 登录页 */
  .login-wrap { padding: 20px; }
  .login-card { width: 100%; max-width: 420px; padding: 24px 20px; }

  .toast { left: 16px; right: 16px; transform: none; top: 64px; text-align: center; }
}

/* 更小的屏（≤400px）再收一点 */
@media (max-width: 400px) {
  .cards { grid-template-columns: 1fr; }
  .resp-table td::before { width: 66px; }
}
