:root {
  --brand: #d42f2f;
  --brand-dark: #b32424;
  --brand-soft: #fdecec;
  --gold: #c3a769;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --side: #1d2129;
  --side-hover: #2b3038;
  --text: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --line: #e5e6eb;
  --green: #00b42a;
  --orange: #ff7d00;
  --blue: #165dff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 20% 10%, #fff1f1 0%, transparent 60%),
              radial-gradient(1000px 500px at 90% 90%, #fff8ec 0%, transparent 55%),
              #f4f5f7;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 34px 32px 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .10);
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.logo {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #f0714f);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
  box-shadow: 0 6px 16px rgba(212, 47, 47, .3);
}
.login-brand h1 { margin: 0; font-size: 20px; letter-spacing: 2px; }
.login-brand p { margin: 2px 0 0; color: var(--text-3); font-size: 12px; letter-spacing: 2px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; outline: none; background: #fafafa; transition: .18s; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft);
}
.login-error { color: var(--brand); font-size: 13px; min-height: 20px; margin-bottom: 6px; }
.login-tip { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--text-3); }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 226px; flex: 0 0 226px; background: var(--side); color: #c9cdd4;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; }
.side-brand-text strong { display: block; color: #fff; font-size: 15px; letter-spacing: 1px; }
.side-brand-text small { color: #86909c; font-size: 11px; letter-spacing: 1px; }
.nav { flex: 1; overflow-y: auto; padding: 8px 10px 20px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: #3a3f47; border-radius: 4px; }
.nav-group { margin-top: 14px; }
.nav-group-title { font-size: 11px; color: #5c636e; padding: 0 10px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px;
  cursor: pointer; font-size: 13.5px; color: #c9cdd4; transition: .15s; margin-bottom: 2px;
  user-select: none;
}
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 500; }
.nav-item .ico { width: 18px; text-align: center; font-size: 14px; }
.nav-item .count {
  margin-left: auto; background: rgba(255,255,255,.16); border-radius: 20px;
  font-size: 11px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.nav-item.active .count { background: rgba(255,255,255,.3); }
.side-foot { padding: 12px 14px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.side-user { font-size: 12px; color: #86909c; padding: 0 4px 10px; word-break: break-all; }
.side-user b { color: #fff; display: block; font-size: 13px; margin-bottom: 2px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { margin: 0; font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.page { padding: 22px 26px 40px; }

/* ---------------- 组件 ---------------- */
.btn {
  border: 1px solid transparent; background: #fff; color: var(--text);
  padding: 8px 16px; border-radius: 9px; font-size: 13.5px; cursor: pointer;
  transition: .16s; font-family: inherit; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-soft { background: #f2f3f5; color: var(--text-2); }
.btn-soft:hover { background: #e8eaed; }
.btn-ghost { background: transparent; color: #c9cdd4; border-color: rgba(255,255,255,.16); }
.btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-danger { background: #fff; color: var(--brand); border-color: #f5c2c2; }
.btn-danger:hover { background: var(--brand-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.icon-btn {
  border: none; background: transparent; cursor: pointer; font-size: 15px;
  color: var(--text-3); width: 30px; height: 30px; border-radius: 8px;
}
.icon-btn:hover { background: #f2f3f5; color: var(--text); }
.badge-soft {
  background: var(--brand-soft); color: var(--brand); font-size: 12px;
  padding: 4px 10px; border-radius: 20px; font-weight: 500;
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -20px; top: -20px; width: 74px; height: 74px;
  border-radius: 50%; background: var(--brand-soft); opacity: .6;
}
.stat .k { font-size: 12.5px; color: var(--text-3); position: relative; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; position: relative; letter-spacing: .5px; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 4px; }

.panel {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head .tools { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; outline: none; background: #fafafa; font-family: inherit;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--brand); background: #fff; }
.toolbar input { min-width: 190px; }

.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #fafbfc; color: var(--text-2); font-weight: 600; white-space: nowrap; font-size: 13px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
td.actions { white-space: nowrap; }
td.actions .btn { margin-right: 6px; }
.empty { text-align: center; color: var(--text-3); padding: 46px 0; font-size: 13.5px; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 1.7; }
.tag-green { background: #e8ffea; color: var(--green); }
.tag-red { background: var(--brand-soft); color: var(--brand); }
.tag-orange { background: #fff7e8; color: var(--orange); }
.tag-blue { background: #e8f3ff; color: var(--blue); }
.tag-gray { background: #f2f3f5; color: var(--text-3); }

.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #f2f3f5; display: block; }
.thumb-lg { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: #f2f3f5; }
.muted { color: var(--text-3); font-size: 12.5px; }
.strong { font-weight: 600; }
.price { color: var(--brand); font-weight: 600; }

.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--text-2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { width: auto; }
.upload-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.upload-box {
  width: 96px; height: 96px; border: 1.5px dashed var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-3); font-size: 12px; background: #fafbfc; overflow: hidden; position: relative;
}
.upload-box img { width: 100%; height: 100%; object-fit: cover; }
.upload-box:hover { border-color: var(--brand); color: var(--brand); }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  background: #f2f3f5; border-radius: 8px; padding: 5px 10px; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip b { cursor: pointer; color: var(--text-3); font-weight: 400; }

/* 使用须知 · 多图列表 */
.notice-list { display: flex; gap: 14px; flex-wrap: wrap; }
.notice-item {
  width: 210px; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #fafbfc;
}
.notice-item img { width: 100%; display: block; background: #fff; }
.notice-item__bar {
  display: flex; gap: 6px; padding: 8px; justify-content: space-between;
  border-top: 1px solid var(--line);
}
.notice-item__bar .btn { margin: 0; }
.chip b:hover { color: var(--brand); }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 720px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28); animation: pop .16s ease-out;
}
@keyframes pop { from { transform: scale(.97); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 900px; }

.toast {
  position: fixed; top: 26px; left: 50%; transform: translateX(-50%);
  background: #1d2129; color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 13.5px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: drop .2s ease-out;
}
.toast.err { background: var(--brand); }
@keyframes drop { from { transform: translate(-50%, -12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.loading { padding: 40px; text-align: center; color: var(--text-3); }

@media (max-width: 900px) {
  .sidebar { width: 66px; flex: 0 0 66px; }
  .side-brand-text, .nav-group-title, .nav-item span:not(.ico), .side-user { display: none; }
  .nav-item { justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
}
