:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft Yahei", sans-serif;
  color: #111827;
  background: #f4f6fb;
  font-synthesis: none;
  --ink: #101828;
  --muted: #64748b;
  --line: #e6eaf1;
  --brand: #7c3aed;
  --brand-dark: #5b21b6;
  --pink: #ee1d52;
  --green: #10b981;
  --card: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f4f6fb; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { background: #111827; color: #f8fafc; padding: 25px 16px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 32px; }
.brand-logo { width: 37px; height: 37px; border-radius: 12px; background: linear-gradient(135deg, #ff0050, #8b5cf6 55%, #22d3ee); display: grid; place-items: center; color: white; font-size: 19px; font-weight: 800; box-shadow: 0 8px 20px #0003; }
.brand strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand small { display: block; color: #9ca3af; font-size: 11px; margin-top: 3px; }
.nav-label { color: #6b7280; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; }
.nav-label-system { margin-top: 18px; }
.nav-item { border: 0; width: 100%; color: #cbd5e1; background: transparent; border-radius: 9px; text-align: left; padding: 11px 12px; display: flex; gap: 11px; align-items: center; margin: 2px 0; font-size: 14px; transition: .15s; }
.nav-item:hover { background: #1f2937; color: #fff; }
.nav-item.active { background: #7c3aed; color: #fff; box-shadow: 0 5px 15px #7c3aed55; }
.nav-icon { width: 18px; text-align: center; font-size: 16px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #293142; padding: 18px 10px 0; color: #94a3b8; font-size: 12px; line-height: 1.7; }
.main { min-width: 0; }
.topbar { height: 72px; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 0 36px; display: flex; align-items: center; justify-content: space-between; }
.topbar-title { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.user-menu { display: flex; align-items: center; gap: 12px; color: #475569; font-size: 13px; }
.user-name { border: 0; background: transparent; padding: 5px 0; color: #475569; font-size: 13px; }
.user-name:hover { color: var(--brand); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #ede9fe; color: #6d28d9; font-weight: 700; }
.logout { border: 0; color: #64748b; background: transparent; font-size: 12px; padding: 6px; }
.content { padding: 30px 36px 60px; max-width: 1440px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 25px; }
.page-head h1 { font-size: 27px; letter-spacing: -.04em; margin: 0 0 7px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.btn { border: 0; border-radius: 8px; padding: 10px 16px; font-size: 13px; font-weight: 650; transition: .15s; display: inline-flex; gap: 7px; align-items: center; justify-content: center; white-space: nowrap; }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 5px 13px #7c3aed30; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-light { background: #fff; color: #374151; border: 1px solid var(--line); }
.btn-light:hover { background: #f8fafc; }
.btn-danger { background: #fff1f2; color: #be123c; }
.btn-plain { border: 0; padding: 5px 7px; background: transparent; color: var(--brand); font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 4px #17255405; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 26px; font-weight: 750; margin-top: 10px; letter-spacing: -.04em; }
.stat .hint { color: #94a3b8; font-size: 11px; margin-top: 5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 4px #17255405; }
.card-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 16px 20px; }
.card-head strong { font-size: 14px; }
.card-body { padding: 20px; }
.settings-card { max-width: 680px; }
.settings-form { max-width: 500px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th { color: #94a3b8; font-size: 11px; text-align: left; font-weight: 650; padding: 12px 20px; background: #fbfcfe; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 15px 20px; border-bottom: 1px solid #eef1f5; font-size: 13px; color: #334155; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.channel-id { font-weight: 700; color: #1e293b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.user-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.user-cell strong { font-size: 13px; color: #1e293b; }
.avatar.small { width: 28px; height: 28px; font-size: 11px; flex: none; }
.pill { border-radius: 99px; font-size: 11px; padding: 4px 9px; display: inline-flex; align-items: center; gap: 4px; }
.pill.green { color: #047857; background: #d1fae5; }
.pill.gray { color: #64748b; background: #f1f5f9; }
.pill.purple { color: #6d28d9; background: #ede9fe; }
.empty { text-align: center; padding: 52px 20px; color: #94a3b8; font-size: 13px; }
.empty-icon { font-size: 34px; margin-bottom: 9px; opacity: .7; }
.modal-backdrop { position: fixed; z-index: 30; inset: 0; background: #0f172a88; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; width: min(520px,100%); border-radius: 14px; box-shadow: 0 20px 70px #0f172a33; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.modal-head strong { font-size: 16px; }
.close { border: 0; background: transparent; color: #64748b; font-size: 22px; line-height: 1; }
.modal-body { padding: 22px; }
.modal-foot { padding: 15px 22px; background: #fafbfc; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.field { margin-bottom: 17px; }
.field label { display: block; font-size: 12px; font-weight: 650; color: #374151; margin-bottom: 7px; }
.input { width: 100%; border: 1px solid #d8dee8; border-radius: 8px; padding: 10px 12px; color: #1e293b; outline: 0; transition: .15s; background: #fff; }
.input[type="password"] { letter-spacing: .03em; }
select.input { appearance: auto; }
.input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px #8b5cf620; }
.hint-box { border-radius: 8px; padding: 11px 13px; font-size: 12px; line-height: 1.7; color: #475569; background: #f8fafc; }
.works-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.work-slot { border: 1px solid var(--line); border-radius: 10px; padding: 15px; }
.slot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.slot-no { width: 23px; height: 23px; border-radius: 7px; color: #6d28d9; background: #ede9fe; display: grid; place-items: center; font-weight: 750; font-size: 12px; }
.slot-head strong { font-size: 13px; }
.slot-status { margin-left: auto; font-size: 10px; color: #94a3b8; }
.slot-status.ok { color: #059669; }
.qr-panel { display: grid; grid-template-columns: 190px 1fr; gap: 25px; align-items: center; }
.qr-box { aspect-ratio: 1; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff; padding: 12px; display: grid; place-items: center; max-width: 190px; }
.qr-box img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.qr-fallback { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(13,1fr); gap: 2px; background: #fff; padding: 2px; }
.qr-fallback i { background: #111827; }
.qr-meta h3 { margin: 0 0 8px; font-size: 17px; }
.qr-meta p { color: var(--muted); line-height: 1.7; font-size: 13px; margin: 0 0 16px; }
.target-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% -20%, #f0e9ff 0, #f7f8fc 45%, #edf1f7 100%); }
.target-card { width: min(460px,100%); border-radius: 22px; background: rgba(255,255,255,.95); padding: 27px; box-shadow: 0 20px 70px #0f172a18; border: 1px solid #fff; }
.target-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; }
.target-brand .brand-logo { width: 33px; height: 33px; border-radius: 10px; }
.target-brand strong { font-size: 15px; }
.target-card h1 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.04em; }
.target-card > p { margin: 0 0 23px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.target-buttons { display: grid; gap: 10px; }
.app-btn { border: 0; color: #fff; border-radius: 11px; padding: 13px 15px; display: flex; align-items: center; text-align: left; gap: 11px; }
.app-btn .app-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; font-size: 18px; background: #fff3; }
.app-btn strong { display: block; font-size: 13px; }
.app-btn small { display: block; opacity: .78; font-size: 10px; margin-top: 3px; }
.app-btn.douyin { background: linear-gradient(105deg,#111827,#374151); }
.app-btn.lite { background: linear-gradient(105deg,#ee1d52,#fa5a79); }
.target-code { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 15px; color: #94a3b8; font-size: 11px; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.target-error { color: #be123c; background: #fff1f2; border-radius: 9px; padding: 12px; font-size: 12px; line-height: 1.6; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1fr) minmax(420px, 1fr); background: #f8f9fc; }
.login-art { background: linear-gradient(145deg,#161126 0,#241447 48%,#111827 100%); color: #fff; padding: 70px 9vw; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; width: 600px; height: 600px; border: 1px solid #ffffff18; border-radius: 50%; top: -230px; right: -120px; box-shadow: 0 0 0 55px #ffffff08, 0 0 0 110px #ffffff04; }
.login-art .brand { padding: 0; position: relative; }
.login-art h1 { max-width: 470px; font-size: clamp(33px, 4vw, 53px); line-height: 1.12; letter-spacing: -.06em; margin: 52px 0 18px; position: relative; }
.login-art > p { color: #c4b5fd; font-size: 15px; line-height: 1.8; max-width: 410px; position: relative; }
.feature-list { position: relative; display: grid; gap: 12px; margin-top: 42px; color: #e2e8f0; font-size: 13px; }
.feature-list span { display: flex; align-items: center; gap: 10px; }
.feature-list i { width: 20px; height: 20px; border-radius: 7px; background: #8b5cf633; color: #c4b5fd; display: grid; place-items: center; font-style: normal; }
.login-form-wrap { display: grid; place-items: center; padding: 35px; }
.login-form { width: min(360px, 100%); }
.login-form h2 { font-size: 27px; margin: 0 0 9px; letter-spacing: -.04em; }
.login-form .sub { color: var(--muted); font-size: 13px; margin: 0 0 31px; }
.login-form .btn { width: 100%; margin-top: 6px; padding: 12px; }
.login-help { margin-top: 17px; font-size: 11px; color: #94a3b8; text-align: center; }
.toast-wrap { position: fixed; z-index: 60; top: 20px; right: 20px; display: grid; gap: 9px; }
.toast { color: #fff; background: #1e293b; box-shadow: 0 8px 30px #0f172a33; border-radius: 9px; padding: 11px 15px; font-size: 12px; animation: toast-in .2s ease-out; }
.toast.success { background: #047857; }
.toast.error { background: #be123c; }
@keyframes toast-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 70px 1fr; }
  .sidebar { padding: 21px 10px; }
  .brand { justify-content: center; padding: 0 0 28px; }
  .brand > div:last-child, .nav-item span:last-child, .nav-label, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 12px 4px; }
  .topbar { padding: 0 22px; }
  .content { padding: 25px 22px 45px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .login-page { display: block; }
  .login-art { min-height: 245px; padding: 28px 25px; }
  .login-art h1 { font-size: 33px; margin: 27px 0 10px; }
  .login-art > p, .feature-list { display: none; }
  .login-form-wrap { padding: 42px 25px; }
  .topbar { height: 62px; padding: 0 16px; }
  .topbar-title { font-size: 17px; }
  .user-menu > span { display: none; }
  .content { padding: 20px 15px 40px; }
  .page-head { flex-direction: column; }
  .page-head .btn { width: 100%; }
  .stat-grid { gap: 9px; }
  .stat { padding: 13px; }
  .stat .value { font-size: 22px; }
  .qr-panel { grid-template-columns: 1fr; }
  .qr-box { width: 180px; justify-self: center; }
  .works-grid { grid-template-columns: 1fr; }
  .card-body { padding: 15px; }
}
