/* CapCut 管理后台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", "Microsoft YaHei", -apple-system, sans-serif; background: #f1f5f9; color: #1e293b; font-size: 14px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; }
.main { flex: 1; margin-left: 220px; padding: 28px 32px 60px; max-width: 1400px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; border-bottom: 1px solid #1e293b; }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.brand-name { font-weight: 700; color: #f1f5f9; font-size: 15px; }

.nav { flex: 1; padding: 14px 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; color: #94a3b8; text-decoration: none; margin-bottom: 4px; font-size: 14px; transition: all .15s; }
.nav-item:hover { background: #1e293b; color: #e2e8f0; }
.nav-item.active { background: #2563eb; color: #fff; font-weight: 600; }
.ic { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.sidebar-foot { padding: 16px 20px; border-top: 1px solid #1e293b; }
.user { color: #e2e8f0; font-size: 13px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout { color: #94a3b8; font-size: 13px; text-decoration: none; }
.logout:hover { color: #f87171; }

/* 页头 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-head h2 { font-size: 22px; font-weight: 700; }
.page-actions { display: flex; align-items: center; gap: 10px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 1px 4px rgba(15,23,42,.06); }
.stat-label { color: #64748b; font-size: 13px; margin-bottom: 8px; }
.stat-val { font-size: 28px; font-weight: 800; color: #0f172a; }

/* 面板 */
.panel { background: #fff; border-radius: 14px; box-shadow: 0 1px 4px rgba(15,23,42,.06); padding: 20px; margin-bottom: 22px; }
.panel-head { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.chart-lg { width: 100%; height: 340px; }

/* 表格 */
.table-panel { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 13px 16px; background: #f8fafc; font-size: 12px; color: #64748b; font-weight: 600; border-bottom: 1px solid #e2e8f0; }
.table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.table tr:hover td { background: #f8fafc; }
.w-title { font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wid { display: block; color: #94a3b8; font-size: 11px; font-weight: 400; }
.w-link { color: #1e40af; text-decoration: none; font-weight: 600; }
.w-link:hover { text-decoration: underline; color: #2563eb; }
.tag-badge { display: inline-block; background: #fef3c7; color: #92400e; font-size: 11px; padding: 2px 8px; border-radius: 12px; }
.ops { white-space: nowrap; }
.op-btn { background: none; border: none; cursor: pointer; font-size: 15px; padding: 3px 5px; border-radius: 6px; color: #64748b; }
.op-btn:hover { background: #f1f5f9; }
.op-btn.star { color: #cbd5e1; }
.op-btn.star.on { color: #f59e0b; }
.num { text-align: right; white-space: nowrap; }
.num b { color: #2563eb; }
.empty { text-align: center; color: #94a3b8; padding: 40px 0; }
.muted { color: #94a3b8; font-size: 12px; }
.small { font-size: 12px; margin-top: 8px; }

/* 工具栏 / 表单 */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.inp { padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 14px; background: #fff; outline: none; transition: border .15s; }
.inp:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.inp.grow { flex: 1; min-width: 220px; }
.lbl { display: block; font-size: 13px; color: #475569; margin: 12px 0 6px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; align-items: center; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* 按钮 */
.btn { padding: 9px 18px; border: none; border-radius: 9px; font-size: 14px; cursor: pointer; font-weight: 600; transition: all .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-ghost { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.btn-ghost:hover:not(:disabled) { background: #e2e8f0; }
.btn-danger-ghost { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger-ghost:hover { background: #fee2e2; }
.btn-block { width: 100%; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; padding: 14px; }

/* 作者卡片 */
.authors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.author-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; background: #fff; transition: box-shadow .15s; }
.author-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,.08); }
.author-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.author-meta { color: #64748b; font-size: 12px; margin-bottom: 3px; }
.author-actions { display: flex; gap: 8px; margin-top: 12px; }

.add-panel .add-row { display: flex; gap: 10px; }

/* 同步日志 */
.pull-box { font-size: 13px; }
.pull-line { margin-bottom: 6px; }
.pull-log { max-height: 200px; overflow-y: auto; background: #0f172a; color: #94e2a2; border-radius: 10px; padding: 12px 14px; margin-top: 10px; font-family: Consolas, monospace; font-size: 12px; }
.pull-log div { padding: 1px 0; line-height: 1.6; }

/* 徽标 */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-warn { background: #fef3c7; color: #b45309; }

/* Toast */
#toast-wrap { position: fixed; top: 20px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #0f172a; color: #f1f5f9; padding: 12px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.25); font-size: 13px; animation: slideIn .25s ease; max-width: 380px; }
.toast.err { background: #7f1d1d; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 帮助列表 */
.help-list { padding-left: 20px; color: #475569; line-height: 2; }

/* 登录页 */
.login-body { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; border-radius: 18px; padding: 40px 36px; width: 380px; box-shadow: 0 24px 60px rgba(2,6,23,.4); }
.login-logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; margin-bottom: 18px; }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.login-sub { color: #64748b; font-size: 13px; margin-bottom: 20px; line-height: 1.6; }
.login-tip { margin-top: 18px; color: #94a3b8; font-size: 12px; line-height: 1.7; background: #f8fafc; border-radius: 8px; padding: 10px 12px; }

.alert { padding: 10px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

@media (max-width: 860px) {
  .sidebar { width: 64px; }
  .sidebar .brand-name, .sidebar .nav-item span:not(.ic), .sidebar .user, .sidebar .logout { display: none; }
  .main { margin-left: 64px; padding: 18px 14px; }
  .nav-item { justify-content: center; padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ===== 登录页（美化版） ===== */
.login-body {
  background: #0b1220;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; position: relative; overflow: hidden;
}
.login-bg {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 18% 12%, rgba(37,99,235,.30), transparent 60%),
    radial-gradient(700px 520px at 85% 82%, rgba(124,58,237,.26), transparent 60%),
    radial-gradient(420px 300px at 72% 8%, rgba(56,189,248,.14), transparent 60%);
}
.login-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.055) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%);
}
.login-card {
  position: relative;
  background: rgba(255,255,255,.97);
  border-radius: 22px;
  padding: 44px 40px 26px;
  width: 400px; max-width: calc(100vw - 40px);
  box-shadow: 0 30px 80px rgba(2,6,23,.6), 0 0 0 1px rgba(255,255,255,.06);
}

.login-head { text-align: center; margin-bottom: 6px; }
.login-logo {
  width: 62px; height: 62px; margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 25px;
  box-shadow: 0 12px 28px rgba(37,99,235,.38);
}
.login-title { font-size: 21px; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
.login-sub { color: #64748b; font-size: 13px; margin-bottom: 22px; }

.login-body form .lbl { margin: 14px 0 6px; }
.inp-wrap { position: relative; }
.inp-wrap .inp { width: 100%; padding: 11px 14px 11px 40px; border-radius: 11px; }
.inp-ic {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; fill: #94a3b8; pointer-events: none; transition: fill .15s;
}
.inp-wrap:focus-within .inp-ic { fill: #2563eb; }

.btn-login {
  width: 100%; margin-top: 24px; padding: 12px; font-size: 15px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff; box-shadow: 0 8px 20px rgba(37,99,235,.32);
}
.btn-login:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37,99,235,.42);
  background: linear-gradient(135deg, #1d4ed8, #4338ca);
}
.btn-login:active { transform: none; }

.login-tip {
  margin-top: 24px; padding: 12px 14px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px;
  color: #64748b; font-size: 12px; line-height: 1.8;
}
.login-foot { margin-top: 18px; text-align: center; color: #94a3b8; font-size: 12px; }
.login-card .alert { margin-bottom: 14px; border-radius: 11px; }

@media (max-width: 480px) {
  .login-card { padding: 34px 24px 20px; }
}
