:root {
  --bg: #F6F7FB;
  --panel: #FFFFFF;
  --line: #E9ECF3;
  --ink: #1E2334;
  --ink-2: #5B6478;
  --ink-3: #98A1B3;
  --brand: #6366F1;
  --brand-soft: #EEF0FF;
  --rose: #F43F5E;
  --green: #10B981;
  --amber: #F59E0B;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(24, 32, 61, .04), 0 8px 24px rgba(24, 32, 61, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ---------------- 布局 ---------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px 14px;
}

.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 18px; }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366F1, #A855F7);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.brand-title { font-size: 14px; font-weight: 650; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }

.nav { flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 11px; color: var(--ink-3); letter-spacing: .08em;
  padding: 14px 10px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--ink-2); font-size: 13.5px;
}
.nav-item:hover { background: #F4F5FA; color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--brand-soft); color: #4338CA; font-weight: 600; }
.nav-ico { width: 18px; text-align: center; font-size: 14px; }

.sidebar-foot {
  display: flex; align-items: center; gap: 9px;
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-soft); color: #4338CA;
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 13px;
}
.who { flex: 1; min-width: 0; }
.who-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-id { font-size: 11px; color: var(--ink-3); }
.icon-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.icon-btn:hover { color: var(--rose); border-color: #FBD5DB; }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1180px; }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.topbar-title h1 { font-size: 22px; }
.topbar-title p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap; background: #fff; color: var(--ink);
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(99, 102, 241, .25); }
.btn-primary:hover { background: #5558E8; }
.btn-ghost { border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #D6DBE8; color: var(--ink); }
.btn-danger { border-color: #FBD5DB; color: #D23652; background: #FFF7F8; }
.btn-danger:hover { background: #FFEDF0; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; height: 42px; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn:disabled:hover { border-color: var(--line); color: var(--ink-2); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
/* 创作 / 产品 / 推荐 三块并列，窄屏自动折行 */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: start; }
.grid-3 > .card { margin-bottom: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); color: inherit;
  transition: transform .15s, border-color .15s;
}
.stat-card:hover { text-decoration: none; transform: translateY(-2px); border-color: #D9DDF0; }
.stat-ico { font-size: 17px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.stat-label { font-size: 12.5px; color: var(--ink-2); }

.notice {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #FFFBEB; border: 1px solid #FDE9B8; color: #8A5A00;
  border-radius: 12px; padding: 11px 14px; font-size: 13px; margin-bottom: 18px;
}
.notice a { color: #8A5A00; text-decoration: underline; }

/* ---------------- 列表 ---------------- */
.rowlist { list-style: none; margin: 0; padding: 0; }
.rowlist li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.rowlist li:last-child { border-bottom: 0; }
.rowlist-main { flex: 1; min-width: 0; }
.rowlist-title { color: var(--ink); font-weight: 550; font-size: 13.5px; }
.rowlist-meta { color: var(--ink-3); font-size: 12px; }
.empty, .hint { color: var(--ink-3); font-size: 12.5px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-count { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }

.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px;
  letter-spacing: .02em; padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #FBFBFE;
}
.table td { padding: 11px 10px; border-bottom: 1px solid #F1F3F9; vertical-align: middle; }
.table tbody tr:hover { background: #FCFCFF; }
.table tbody tr:last-child td { border-bottom: 0; }
.th-actions, .td-actions { text-align: right; white-space: nowrap; }
.td-actions .btn { margin-left: 4px; }
.inline-form { display: inline; }

.strong { font-weight: 600; }
.muted { color: var(--ink-3); }
.thumb { width: 54px; height: 38px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); background: #F3F4F9; }
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink-3); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill.on { background: #E9FBF3; color: #0E9F6E; }
.pill.off { background: #F3F4F8; color: #7A8296; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; }
.badge-indigo { background: var(--brand-soft); color: #4338CA; }
.badge-slate { background: #F1F3F9; color: #5B6478; }
.badge-rose { background: #FFF0F3; color: #D23652; }
.badge-green { background: #E9FBF3; color: #0E9F6E; }
/* 顶部福利条的三种配色，与小程序 .reward-strip--{theme} 一一对应 */
.badge-amber { background: #FEF6E7; color: #B45309; }
.badge-indigo-solid { background: #E6E8FF; color: #4338CA; }
.badge-emerald { background: #E7F8F1; color: #047857; }

.stars { color: #E08A00; letter-spacing: 1px; font-size: 13px; }
.stat-hint { margin-top: 3px; font-size: 10.5px; color: #B08A00; line-height: 1.3; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  background: #F3F4FA; color: var(--ink-2); font-size: 11.5px;
}

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 16px; }
.pager-btn { border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; font-size: 12.5px; color: var(--ink-2); }
.pager-btn:hover { text-decoration: none; border-color: #D6DBE8; color: var(--ink); }
.pager-btn.disabled { color: #C4CAD8; border-color: #EFF1F7; }
.pager-info { font-size: 12.5px; color: var(--ink-3); }

.empty-state { text-align: center; padding: 42px 0 30px; color: var(--ink-3); }
.empty-ico { font-size: 30px; margin-bottom: 6px; }

/* ---------------- 表单 ---------------- */
.form { max-width: 880px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { margin-bottom: 0; }
.field.span-full { grid-column: 1 / -1; }
.field.span-half { grid-column: span 1; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.req { color: var(--rose); margin-left: 3px; }
.field-help { margin: 5px 0 0; font-size: 11.5px; color: var(--ink-3); }
.compress-note { margin: 5px 0 0; font-size: 11.5px; color: var(--green); font-weight: 550; }
.compress-note.is-muted { color: var(--ink-3); font-weight: 400; }
.compress-note[hidden] { display: none; }
.hint-inline { margin-left: 6px; font-weight: 400; color: var(--ink-3); }

.input {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); font-size: 13.5px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: #B9BCF7; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.textarea { height: auto; padding: 9px 11px; line-height: 1.65; resize: vertical; }
.input-search { max-width: 300px; }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 40px; height: 22px; border-radius: 999px; background: #E3E6F0;
  position: relative; transition: background .18s; flex: 0 0 40px;
}
.switch-dot {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(18px); }
.switch-text { font-size: 12.5px; color: var(--ink-3); }

.image-row { display: flex; gap: 10px; align-items: center; }
.image-hint { font-size: 12px; color: var(--ink-3); }
.image-preview { margin-top: 10px; }
.image-preview img {
  max-width: 320px; width: 100%; border-radius: 10px;
  border: 1px solid var(--line); display: block;
}

/* ---- 分享配置页：标题 + 虚线上传区（图1 版式） ---- */
.share-card { max-width: 980px; padding: 0 0 22px; overflow: hidden; }
.share-head { margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); justify-content: flex-start; }
.share-head h2 { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.share-bar { width: 3px; height: 14px; border-radius: 2px; background: #2563EB; display: inline-block; }
.share-card > .field { padding: 0 22px; margin-top: 20px; }
.share-title-input { height: 44px; font-size: 14px; }
.share-drop {
  min-height: 250px; padding: 14px;
  border: 1.5px dashed #4A90FF; border-radius: 10px; background: #F2F7FF;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.share-drop:hover, .share-drop.is-drag { background: #E8F1FF; border-color: #2563EB; }
.share-drop-hint { flex: 1; text-align: center; color: var(--ink-2); pointer-events: none; }
.share-drop-ico { font-size: 30px; margin-bottom: 6px; opacity: .75; }
.share-drop-main { font-size: 13.5px; font-weight: 550; }
.share-drop-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.share-preview {
  width: 210px; height: 220px; max-width: 45%; object-fit: cover;
  border-radius: 14px; display: block; box-shadow: 0 2px 10px rgba(24, 32, 61, .10);
}
.share-preview[hidden] { display: none; }
.share-tools { flex-wrap: wrap; margin-top: 10px; }
.share-tools .compress-note { flex-basis: 100%; margin-top: 2px; }
.share-foot { display: flex; justify-content: flex-start; padding: 20px 22px 0; }
.share-foot .btn-primary {
  min-width: 96px; height: 38px;
  background: #2563EB; box-shadow: 0 2px 8px rgba(37, 99, 235, .25);
}
.share-foot .btn-primary:hover { background: #1D4ED8; }

/* ---- 跳转配置：标题 + 圆点单选 + 按类型显示的输入框 ---- */
.jump-block {
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FCFCFE;
}
.jump-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.jump-title { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.jump-radios { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; }
.jump-radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.jump-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.jump-dot {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid #C9D2E3;
  border-radius: 50%;
  background: #FFF;
  flex-shrink: 0;
}
.jump-radio.active .jump-dot { border-color: #2563EB; }
.jump-radio.active .jump-dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #2563EB;
}
.jump-radio-label { font-size: 13px; color: var(--ink-2); }
.jump-radio.active .jump-radio-label { color: #2563EB; font-weight: 600; }
.jump-fields { margin-top: 12px; }
.jump-row { margin-top: 10px; }
.jump-row[hidden] { display: none; }
.jump-row .input { width: 100%; }
@media (max-width: 720px) {
  .jump-radios { gap: 8px 14px; }
  .jump-title { font-size: 12.5px; }
}

.form-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }

/* ---------------- 提示 ---------------- */
.toasts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.toast {
  padding: 9px 13px; border-radius: 10px; font-size: 13px;
  border: 1px solid transparent;
}
.toast.ok { background: #EAFBF3; border-color: #C7F0DD; color: #0E7A56; }
.toast.err { background: #FFF3F5; border-color: #FBD5DB; color: #C22C48; }
.toast.inline { margin-bottom: 14px; }

.keyrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: #F7F8FC; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; color: #3A4257; word-break: break-all;
}
.code-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; background: #F3F4FA; border-radius: 5px; padding: 1px 5px; color: #3A4257;
}
.snippet {
  margin: 0; padding: 14px; border-radius: 10px; overflow-x: auto;
  background: #1B1E2B; color: #D8DCF0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.7;
}
.dot { color: var(--ink-3); margin: 0 6px; }

/* ---------------- 登录 ---------------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #EEF0FF 0%, #F6F7FB 55%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 26px; box-shadow: 0 18px 50px rgba(24, 32, 61, .09);
}
.login-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.login-title { font-size: 14.5px; font-weight: 650; }
.login-sub { font-size: 12px; color: var(--ink-3); }
.login-form .field { margin-bottom: 14px; }
.login-hint { font-size: 11.5px; color: var(--ink-3); margin: 14px 0 0; }
.error-card { text-align: center; }
.error-code { font-size: 40px; font-weight: 700; color: var(--brand); }
.error-msg { color: var(--ink-2); margin: 6px 0 18px; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 14px;
  }
  .nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .nav-label { display: none; }
  .nav-item { border: 1px solid var(--line); }
  .sidebar-foot { margin-top: 10px; }
  .main { padding: 18px 16px 48px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-half { grid-column: 1 / -1; }
  .topbar { flex-direction: column; }
  .topbar-actions { width: 100%; }
}
