/* 清风徐来 · 浅色简约后台 UI 规范 */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --border: #e9edf4;
  --border-strong: #dbe2ee;
  --text: #1f2937;
  --text-2: #4b5563;
  --muted: #8a94a6;
  --primary: #ff7a45;
  --primary-600: #f2622a;
  --primary-soft: #fff3ec;
  --success: #2bb673;
  --success-soft: #e9f8f0;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --warn: #f0a020;
  --warn-soft: #fff6e6;
  --blue: #4d7cfe;
  --blue-soft: #eef3ff;
  --purple: #8b5cf6;
  --pink: #f2789f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 48px rgba(16, 24, 40, .14);
  --side-w: 224px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
::selection { background: var(--primary-soft); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d7dde8; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 通用组件 ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h3 {
  margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 9px;
}
.card-head h3::before {
  content: ""; width: 3px; height: 14px; border-radius: 3px; background: var(--primary);
}
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.card-body { padding: 18px 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-2);
  cursor: pointer; transition: .16s; white-space: nowrap; font-weight: 500;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f5c9ca; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { height: 42px; font-size: 15px; border-radius: 10px; }
.btn-link { border: none; background: none; color: var(--primary); padding: 0 4px; height: auto; }
.btn-link:hover { background: none; text-decoration: underline; }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; outline: none; transition: .15s;
}
.textarea { height: auto; padding: 9px 12px; resize: vertical; min-height: 78px; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder, .textarea::placeholder { color: #b3bccb; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--danger); font-size: 12px; margin-top: 5px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-gray { background: #f1f3f7; color: var(--muted); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--muted);
  padding: 11px 14px; background: #fafbfd; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: #fbfcfe; }
.table-wrap { overflow-x: auto; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  height: 32px; padding: 0 14px; border-radius: 20px; border: 1px solid transparent;
  background: transparent; cursor: pointer; color: var(--text-2); font-size: 13px; transition: .15s;
}
.tab:hover { background: #f2f4f9; }
.tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 34px; opacity: .45; margin-bottom: 8px; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; background: #d8dfea; border-radius: 20px; transition: .18s; cursor: pointer;
}
.switch i::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px;
  background: #f2f4f9; color: var(--muted); margin-right: 6px;
}

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; }
.pager .btn { min-width: 32px; padding: 0 10px; }

/* ============ 登录页 ============ */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-hero {
  position: relative; overflow: hidden; padding: 56px 60px; color: #fff;
  background: linear-gradient(150deg, #ff9a6c 0%, #ff7a45 42%, #f2622a 100%);
  display: flex; flex-direction: column;
}
.login-hero::after {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: rgba(255,255,255,.10); right: -160px; top: -120px;
}
.login-hero::before {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255,255,255,.08); left: -120px; bottom: -110px;
}
.brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.22);
  display: grid; place-items: center; font-size: 22px;
}
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.hero-slogan { margin-top: 64px; position: relative; z-index: 1; }
.hero-slogan h1 { font-size: 36px; margin: 0 0 14px; font-weight: 700; letter-spacing: 1px; }
.hero-slogan p { font-size: 15px; opacity: .92; margin: 0; max-width: 440px; line-height: 1.9; }
.hero-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; position: relative; z-index: 1; }
.hero-tags span {
  padding: 5px 14px; border-radius: 20px; background: rgba(255,255,255,.18);
  font-size: 13px; backdrop-filter: blur(4px);
}
.hero-channels { margin-top: 40px; position: relative; z-index: 1; }
.hero-channels h4 { font-size: 14px; opacity: .9; margin: 0 0 12px; font-weight: 500; }
.chan-list { display: grid; gap: 10px; }
.chan-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,.14); font-size: 13px;
}
.hero-foot { margin-top: auto; position: relative; z-index: 1; font-size: 12px; opacity: .8; }
.hero-preview-btn {
  margin-top: 26px; position: relative; z-index: 1; align-self: flex-start;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4); color: #fff;
  height: 36px; padding: 0 18px; border-radius: 20px; cursor: pointer; backdrop-filter: blur(4px);
}
.hero-preview-btn:hover { background: rgba(255,255,255,.3); }

.login-form-wrap { display: grid; place-items: center; padding: 40px; background: #fff; }
.login-form { width: 100%; max-width: 340px; }
.login-form h2 { font-size: 24px; margin: 0 0 6px; }
.login-form .tip { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-switch { display: flex; gap: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.login-switch button {
  border: none; background: none; padding: 0 0 10px; cursor: pointer; color: var(--muted);
  font-size: 15px; position: relative;
}
.login-switch button.active { color: var(--text); font-weight: 600; }
.login-switch button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary);
}
.third-login { margin-top: 22px; }
.third-login .label {
  text-align: center; color: var(--muted); font-size: 12px; position: relative; margin-bottom: 16px;
}
.third-login .label::before, .third-login .label::after {
  content: ""; position: absolute; top: 50%; width: 30%; height: 1px; background: var(--border);
}
.third-login .label::before { left: 0; } .third-login .label::after { right: 0; }
.third-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.third-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  cursor: pointer; color: var(--text-2); transition: .15s;
}
.third-btn:hover { border-color: var(--primary); color: var(--primary); }
.login-reg { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.login-reg a { color: var(--primary); cursor: pointer; }
.demo-tip {
  margin-top: 18px; padding: 10px 12px; background: var(--primary-soft); border-radius: 10px;
  font-size: 12px; color: var(--primary-600); line-height: 1.8;
}

/* ============ 应用外壳 ============ */
.app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 60px; background: #fff;
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; padding: 0 22px;
}
.topbar .left { display: flex; align-items: center; gap: 14px; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar .brand-name { font-size: 18px; color: var(--text); }
.topbar .brand-logo { width: 32px; height: 32px; font-size: 17px; background: var(--primary-soft); color: var(--primary); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn .dot-new { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #ffb08c, #ff7a45);
  color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; cursor: pointer;
  overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu { position: relative; }
.dropdown {
  position: absolute; right: 0; top: 44px; min-width: 190px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
}
.dropdown .item {
  padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 9px; font-size: 13px;
}
.dropdown .item:hover { background: #f6f8fc; }
.dropdown .sep { height: 1px; background: var(--border); margin: 5px 4px; }

.shell { display: grid; grid-template-columns: var(--side-w) 1fr; align-items: start; }
.sidebar {
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
  background: #fff; border-right: 1px solid var(--border); padding: 14px 12px;
}
.side-group { margin-bottom: 6px; }
.side-group .gt { font-size: 12px; color: var(--muted); padding: 10px 12px 6px; }
/* 可折叠分组标题 */
.side-group .gt-toggle {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  font-size: 13px; color: var(--text-2); padding: 9px 12px; border-radius: 10px; transition: .15s;
}
.side-group .gt-toggle:hover { background: #f6f8fc; color: var(--text); }
.side-group .gt-toggle .ic { width: 18px; text-align: center; opacity: .9; }
.side-group .gt-toggle .arw { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); }
.side-group .sub { padding-left: 6px; }
.side-group .sub .side-item { font-size: 13.5px; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  cursor: pointer; color: var(--text-2); font-size: 14px; margin-bottom: 2px; position: relative; transition: .15s;
}
.side-item:hover { background: #f6f8fc; color: var(--text); }
.side-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.side-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.side-item .ic { width: 18px; text-align: center; opacity: .9; }
.side-item .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }
.main { padding: 20px 24px 40px; min-width: 0; }
.page-head { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 19px; font-weight: 600; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); } .crumb a:hover { color: var(--primary); }

/* ============ 仪表盘 ============ */
.welcome {
  background: linear-gradient(120deg, #fff6f1 0%, #fff 60%);
  border: 1px solid #ffe2d1; border-radius: var(--radius); padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.welcome::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255,122,69,.06);
}
.welcome h2 { margin: 0 0 8px; font-size: 20px; }
.welcome .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.welcome .right { text-align: right; position: relative; z-index: 1; }
.welcome .date { font-size: 15px; font-weight: 600; }
.welcome .slogan { color: var(--primary); font-size: 13px; margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.stat .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none;
}
.stat .v { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat .k { font-size: 13px; color: var(--muted); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; margin-top: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }

.quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.quick-item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 10px; text-align: center; cursor: pointer; transition: .18s; box-shadow: var(--shadow);
}
.quick-item:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.quick-item .ico {
  width: 40px; height: 40px; margin: 0 auto 9px; border-radius: 12px; display: grid; place-items: center; font-size: 19px;
}
.quick-item .t { font-size: 13px; font-weight: 500; }

.video-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.video-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: .18s; background: #fff; }
.video-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.video-thumb {
  height: 108px; display: grid; place-items: center; color: #fff; font-size: 28px;
  background: linear-gradient(135deg, #ffb08c, #ff7a45); position: relative;
}
.video-thumb .dur { position: absolute; right: 8px; bottom: 8px; font-size: 11px; background: rgba(0,0,0,.4); padding: 1px 6px; border-radius: 4px; }
.video-card .t { padding: 10px 12px; font-size: 13px; font-weight: 500; }
.video-card .s { padding: 0 12px 10px; font-size: 12px; color: var(--muted); }

/* ============ 推送卡片预览 ============ */
.push-card {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; max-width: 340px;
}
.push-card .ph {
  padding: 12px 16px; color: #fff; display: flex; align-items: center; justify-content: space-between;
}
.push-card .ph .n { font-weight: 600; font-size: 14px; }
.push-card .ph .c { font-size: 12px; opacity: .9; }
.push-card .pb { padding: 14px 16px; }
.push-card .pb .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.push-card .pb .row + .row { border-top: 1px dashed var(--border); }
.push-card .pb .row .k { color: var(--muted); flex: none; }
.push-card .pb .row .v { text-align: right; color: var(--text); }
.push-card .pf { padding: 10px 16px; background: #fafbfd; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

/* ============ 模板市场 ============ */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tpl-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: .18s;
}
.tpl-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tpl-card .th { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tpl-card .name { font-weight: 600; font-size: 15px; }
.tpl-card .desc { color: var(--muted); font-size: 12px; margin: 0 0 12px; min-height: 34px; }
.tpl-card .prev { background: #fafbfd; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.tpl-card .foot { margin-top: auto; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

/* ============ 排期日历 ============ */
.cal { width: 100%; border-collapse: separate; border-spacing: 0; }
.cal th, .cal td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal th:last-child, .cal td:last-child { border-right: none; }
.cal th { background: #fafbfd; padding: 10px; text-align: center; font-size: 13px; color: var(--text-2); }
.cal th.today { color: var(--primary); }
.cal th .d { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.cal td { padding: 8px; vertical-align: top; height: 96px; width: 12.5%; }
.cal td:first-child { width: 110px; background: #fafbfd; text-align: center; color: var(--text-2); font-size: 13px; }
.cal .slot-chip {
  background: var(--blue-soft); color: var(--blue); border-radius: 8px; padding: 6px 8px;
  font-size: 12px; margin-bottom: 6px; cursor: pointer; transition: .15s;
}
.cal .slot-chip:hover { background: #e0e9ff; }
.cal .slot-chip .t { font-weight: 600; display: block; }
.cal .slot-chip .p { opacity: .85; }

/* ============ 文案广场 ============ */
.quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quote-card { position: relative;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; transition: .18s;
}
/* 自己投稿的文案：右上角「已投稿」角标 */
.quote-card .q-mine {
  position: absolute; top: 10px; right: 10px; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: #e9f8f0; color: #1a7f4b; border: 1px solid #cdeedc;
}
.quote-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.quote-card .txt { font-size: 15px; line-height: 1.9; flex: 1; }
.quote-card .qf { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.like { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; cursor: pointer; }
.like:hover, .like.on { color: var(--pink); }

/* ============ 图片库 ============ */
.img-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.img-item {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; position: relative; cursor: pointer;
}
.img-item.sel { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.img-thumb { height: 118px; display: grid; place-items: center; font-size: 26px; }
.img-item img { width: 100%; height: 118px; object-fit: cover; display: block; }
.img-item .n { padding: 8px 10px; font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }
.img-check { position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.85); display: grid; place-items: center; font-size: 12px; color: var(--primary); }

/* ============ 弹窗 ============ */
.mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 100;
  display: grid; place-items: center; padding: 24px; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98) } to { opacity: 1; transform: none } }
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%;
  max-height: 90vh; display: flex; flex-direction: column; animation: pop .2s ease;
}
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--text); }

.steps { display: flex; align-items: center; justify-content: center; gap: 0; padding: 4px 0 22px; }
.step { display: flex; align-items: center; gap: 9px; }
.step .n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #f1f3f7; color: var(--muted); font-size: 13px; font-weight: 600; flex: none;
}
.step.active .n { background: var(--primary); color: #fff; }
.step.done .n { background: var(--success-soft); color: var(--success); }
.step .t { font-size: 13px; color: var(--muted); }
.step.active .t { color: var(--text); font-weight: 600; }
.step-line { width: 70px; height: 2px; background: var(--border); margin: 0 14px; }
.step-line.done { background: var(--success); }

.wizard { display: grid; grid-template-columns: 1fr 300px; gap: 22px; }
.wizard .right { border-left: 1px dashed var(--border); padding-left: 22px; }
.wizard .right .lbl { font-size: 12px; color: var(--muted); margin-bottom: 10px; }

.chan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.chan-card {
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 14px; cursor: pointer; transition: .16s; text-align: center;
}
.chan-card:hover { border-color: var(--primary); }
.chan-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(255,122,69,.08); }
.chan-card .ic { font-size: 22px; margin-bottom: 6px; }
.chan-card .n { font-weight: 600; font-size: 14px; }
.chan-card .d { font-size: 12px; color: var(--muted); margin-top: 3px; }

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill {
  padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 20px; cursor: pointer; font-size: 13px; transition: .15s;
}
.radio-pill.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 500; }

.range { width: 100%; accent-color: var(--primary); }

/* ============ 提示 ============ */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px;
  box-shadow: var(--shadow-lg); font-size: 13px; display: flex; align-items: center; gap: 8px; animation: pop .18s;
}
.toast.success { border-color: #b7e6cd; background: var(--success-soft); color: #1c7d4f; }
.toast.error { border-color: #f5c9ca; background: var(--danger-soft); color: #b32a2e; }

.loading { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ============ ASCII 工具 ============ */
.ascii-grid { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.drop {
  border: 2px dashed var(--border-strong); border-radius: 12px; padding: 28px 18px; text-align: center;
  color: var(--muted); cursor: pointer; transition: .16s; background: #fbfcfe;
}
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.drop .big { font-size: 28px; margin-bottom: 8px; }
.ascii-out {
  background: #0f172a; color: #7dd3a0; border-radius: 12px; padding: 14px; overflow: auto; max-height: 460px;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace; font-size: 6px; line-height: 6px; white-space: pre;
}
.ascii-out.light { background: #fff; color: #1f2937; }
.color-block { width: 100%; height: 118px; border-radius: 10px; }

.rank-list { display: grid; gap: 9px; }
.rank-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rank-item .rk {
  width: 20px; height: 20px; border-radius: 6px; background: #f1f3f7; color: var(--muted);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none;
}
.rank-item.top .rk { background: var(--primary-soft); color: var(--primary); }
.rank-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .bar { width: 92px; height: 6px; background: #f1f3f7; border-radius: 6px; overflow: hidden; flex: none; }
.rank-item .bar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.rank-item .ct { width: 52px; text-align: right; color: var(--muted); flex: none; }

.kv-list { display: grid; gap: 12px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.search-box { position: relative; width: 240px; }
.search-box .input { padding-left: 32px; }
.search-box .si { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(3, 1fr); }
  .tpl-grid, .quote-grid { grid-template-columns: repeat(2, 1fr); }
  .img-grid { grid-template-columns: repeat(3, 1fr); }
  .ascii-grid { grid-template-columns: 1fr; }
  .wizard { grid-template-columns: 1fr; }
  .wizard .right { border-left: none; border-top: 1px dashed var(--border); padding-left: 0; padding-top: 18px; }
}
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
