/* =========================================================
   小雪 Yy 工作室 · 后台样式（白色 / 轻量 / 高级感）
   ========================================================= */

:root {
  --ink: #0c1322;
  --ink-2: #39435a;
  --muted: #6c778c;
  --line: #e8ecf3;
  --line-2: #f1f4f9;
  --soft: #f7f9fc;
  --bg-app: #fbfcfe;
  --accent: #2f4bff;
  --accent-2: #7a3ff2;
  --accent-soft: #eef2ff;
  --accent-ink: #1c2fa8;
  --green: #12a05c;
  --green-soft: #e9f8f0;
  --amber: #b7791f;
  --amber-soft: #fdf6e7;
  --red: #d14343;
  --red-soft: #fdeeee;
  --radius: 16px;
  --shadow-xs: 0 1px 2px rgba(12, 19, 34, .05);
  --shadow-sm: 0 14px 40px -26px rgba(12, 19, 34, .3), 0 1px 2px rgba(12, 19, 34, .04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg-app);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }

.ico { width: 18px; height: 18px; flex: 0 0 auto; }

/* --------------------------------------------------------- 侧边栏 */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform .24s ease;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 20px 18px;
}
.sb-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(145deg, #3b55ff, #6a3df0);
  box-shadow: 0 10px 22px -12px rgba(47, 75, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
  flex: 0 0 auto;
}
.sb-name { font-size: 14.5px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.sb-role { font-size: 10.5px; letter-spacing: .16em; color: #9aa4b8; font-weight: 600; text-transform: uppercase; }

.sb-nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.sb-group {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a7b0c0;
  padding: 16px 10px 8px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 11px;
  color: #4b566c;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .16s ease, color .16s ease;
}
.sb-item .ico { width: 17px; height: 17px; color: #8b96aa; transition: color .16s; }
.sb-item:hover { background: var(--soft); color: var(--ink); }
.sb-item:hover .ico { color: var(--ink-2); }
.sb-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #e2e8ff;
}
.sb-item.is-active .ico { color: var(--accent); }
.sb-item .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #8b96aa;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
}

.sb-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--soft);
  border: 1px solid var(--line-2);
}
.sb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
.sb-user b { display: block; font-size: 13px; line-height: 1.35; }
.sb-user span { font-size: 11px; color: var(--muted); }
.sb-out {
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #97a1b3;
  border: 1px solid transparent;
}
.sb-out:hover { color: var(--red); background: var(--red-soft); }

/* --------------------------------------------------------- 主区域 */
.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #98a2b5; }
.tb-crumb b { color: var(--ink); font-weight: 600; font-size: 14px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-site {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}
.tb-site:hover { border-color: #d3dbea; }
.tb-site .ico { width: 15px; height: 15px; color: #97a1b3; }

.sb-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
}

.content { padding: 30px; max-width: 1180px; width: 100%; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-title { font-size: 23px; font-weight: 750; letter-spacing: -.03em; }
.page-desc { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* --------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 41px;
  padding: 0 17px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.btn .ico { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); border-radius: 11px; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #2f4bff, #6b3df0);
  box-shadow: 0 12px 24px -14px rgba(47, 75, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -14px rgba(47, 75, 255, .95); }

.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { border-color: #d3dbea; background: #fcfdff; }

.btn-soft { background: var(--accent-soft); color: var(--accent-ink); border-color: #e0e6ff; }
.btn-soft:hover { background: #e6ebff; }

.btn-danger { background: var(--red-soft); color: #a72e2e; border-color: #f7dada; }
.btn-danger:hover { background: #fbe2e2; }

.btn-sm { height: 33px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-sm .ico { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: #7c8798;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.icon-btn:hover { color: var(--ink); border-color: #d3dbea; }
.icon-btn.danger:hover { color: var(--red); background: var(--red-soft); border-color: #f6d8d8; }
.icon-btn .ico { width: 15px; height: 15px; }

/* --------------------------------------------------------- 卡片 */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.card-head p { font-size: 12.5px; color: #98a2b5; margin-top: 3px; }
.card-body { padding: 22px; }
.card-body.tight { padding: 0; }

/* 数据卡 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 19px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.stat-card .st-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-card .st-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.st-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #e3e9ff;
}
.st-ico.green { background: var(--green-soft); color: var(--green); border-color: #d9f0e4; }
.st-ico.amber { background: var(--amber-soft); color: var(--amber); border-color: #f6e9c9; }
.st-ico.violet { background: #f4efff; color: #7a3ff2; border-color: #eae1ff; }
.st-ico .ico { width: 16px; height: 16px; }
.stat-card b { display: block; margin-top: 10px; font-size: 27px; font-weight: 750; letter-spacing: -.035em; line-height: 1.2; }
.stat-card small { font-size: 12px; color: #98a2b5; }

/* --------------------------------------------------------- 表格 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #98a2b5;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: #fcfdff;
  white-space: nowrap;
}
table.tbl td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13.8px;
  vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #fcfdff; }
table.tbl .cell-main { font-weight: 600; color: var(--ink); }
table.tbl .cell-sub { font-size: 12.5px; color: #8b96aa; margin-top: 2px; }
table.tbl .num { font-variant-numeric: tabular-nums; color: #8b96aa; font-size: 12.5px; }
table.tbl .col-actions { text-align: right; white-space: nowrap; }
table.tbl .row-actions { display: inline-flex; gap: 6px; }

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--green); background: var(--green-soft); border: 1px solid #d9f0e4; }
.badge-gray { color: #8b96aa; background: var(--soft); border: 1px solid var(--line); }
.badge-blue { color: var(--accent-ink); background: var(--accent-soft); border: 1px solid #e0e6ff; }
.badge-amber { color: var(--amber); background: var(--amber-soft); border: 1px solid #f6e9c9; }

/* 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 54px 20px;
  text-align: center;
}
.empty .e-ico {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--soft);
  border: 1px solid var(--line-2);
  color: #a9b4c8;
  margin-bottom: 4px;
}
.empty b { font-size: 14px; font-weight: 650; }
.empty span { font-size: 12.5px; color: #98a2b5; }
.empty .btn { margin-top: 10px; }

/* --------------------------------------------------------- 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.8px; font-weight: 650; color: #38425a; margin-bottom: 7px; }
.field label .req { color: var(--accent); }
.field .hint { font-size: 12px; color: #98a2b5; margin-top: 6px; line-height: 1.6; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #dfe5ef;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.75; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b96aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  padding-right: 34px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #a3b1ff;
  box-shadow: 0 0 0 3px rgba(47, 75, 255, .11);
}
input::placeholder, textarea::placeholder { color: #b3bccb; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: #e3e8f1;
  position: relative;
  transition: background .18s ease;
  flex: 0 0 auto;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(12, 19, 34, .22);
  transition: transform .18s ease;
}
.switch input:checked + .track { background: linear-gradient(135deg, #3b55ff, #6b3df0); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch span.lbl { font-size: 13.5px; color: var(--ink-2); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-2);
  background: #fcfdff;
  flex-wrap: wrap;
}
.form-actions .note { font-size: 12.5px; color: #98a2b5; }

/* 提示条 */
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.flash .ico { width: 17px; height: 17px; margin-top: 2px; }
.flash-success { background: var(--green-soft); border-color: #d5efe1; color: #0d7a46; }
.flash-error { background: var(--red-soft); border-color: #f7d9d9; color: #a32d2d; }
.flash-info { background: var(--accent-soft); border-color: #e0e6ff; color: var(--accent-ink); }

/* 列表小卡 */
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.quick a:hover { border-color: #d3dbea; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.quick .q-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #e3e9ff;
}
.quick b { display: block; font-size: 13.5px; font-weight: 650; }
.quick span { font-size: 11.8px; color: #98a2b5; }

.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }

/* 前台预览卡 */
.preview-strip {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f7f9ff, #fdfbff);
  padding: 16px 18px;
  overflow: hidden;
}
.preview-strip .ps-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #a7b0c0; font-weight: 700; }
.preview-strip h4 { font-size: 15px; margin-top: 6px; letter-spacing: -.02em; }
.preview-strip p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.meta-list { display: grid; gap: 0; }
.meta-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.meta-list div:last-child { border-bottom: 0; }
.meta-list span { color: #98a2b5; }
.meta-list b { font-weight: 600; }

/* --------------------------------------------------------- 登录页 */
.login-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  background: #fff;
}
.login-aside {
  position: relative;
  overflow: hidden;
  padding: 46px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(90% 70% at 90% 0%, #eae7ff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(80% 60% at 0% 100%, #e7efff 0%, rgba(255, 255, 255, 0) 64%),
    #fbfcff;
  border-right: 1px solid var(--line);
}
.login-aside::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -160px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1px solid rgba(122, 63, 242, .12);
  box-shadow: 0 0 0 60px rgba(122, 63, 242, .03), 0 0 0 120px rgba(47, 75, 255, .025);
}
.la-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.la-copy { position: relative; z-index: 1; margin: 40px 0; }
.la-copy h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.24; letter-spacing: -.035em; font-weight: 750; }
.la-copy h1 .grad {
  background: linear-gradient(100deg, #2f4bff, #7a3ff2);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.la-copy p { margin-top: 16px; font-size: 14.5px; color: var(--muted); max-width: 26em; line-height: 1.9; }
.la-list { display: grid; gap: 11px; margin-top: 30px; }
.la-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.la-list .pt {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); color: var(--accent);
}
.la-list .pt .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.la-foot { position: relative; z-index: 1; font-size: 12px; color: #9aa4b8; }

.login-main { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 23px; font-weight: 750; letter-spacing: -.03em; }
.login-card .lg-sub { font-size: 13.5px; color: var(--muted); margin-top: 7px; margin-bottom: 26px; }
.login-card .field { margin-bottom: 15px; }
.login-card .btn { margin-top: 6px; height: 45px; }
.lg-tip {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; color: #8b96aa; margin-top: 18px; line-height: 1.7;
}
.lg-tip .ico { width: 15px; height: 15px; margin-top: 2px; color: #aeb8ca; }
.login-foot { margin-top: 30px; font-size: 12px; color: #a7b0c0; text-align: center; }
.login-foot a { color: var(--accent); }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 42px; }
.input-wrap .peek {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #a7b0c0;
  cursor: pointer;
  border-radius: 7px;
}
.input-wrap .peek:hover { color: var(--ink-2); background: var(--soft); }

/* 遮罩 */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(12, 19, 34, .28);
  backdrop-filter: blur(2px);
  z-index: 45;
  display: none;
}
.scrim.is-open { display: block; }

/* --------------------------------------------------------- 响应式 */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 20px 60px rgba(12, 19, 34, .18); }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .sb-toggle { display: grid; }
  .topbar { padding: 0 18px; }
  .content { padding: 20px 18px 40px; }
  .login-body { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .quick { grid-template-columns: 1fr; }
  .page-title { font-size: 20px; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .form-actions { padding: 14px 16px; }
  table.tbl th, table.tbl td { padding: 12px 14px; }
}
