/* TagHowWell 官网后台样式 */
:root {
  --bg: #f4f6fa;
  --card: #fff;
  --ink: #16283d;
  --muted: #6b7c93;
  --line: #e3eaf3;
  --accent: #2f6be0;
  --danger: #d8443c;
  --ok: #1f9d63;
  --warn: #c8811a;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: #26384d;
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); letter-spacing: -.01em; }
a { text-decoration: none; color: inherit; }
code { background: #eef3f9; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; color: #4e6580; }

/* ------------------------------------------------------------ 框架 */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 238px;
  flex: none;
  background: #16283d;
  color: #c3cede;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 10px 30px;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; color: #fff; }
.side__logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4c8dff, #7b5cf0);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  flex: none;
}
.side__name { font-size: 15px; font-weight: 700; line-height: 1.2; }
.side__name small {
  display: block; font-size: 10px; font-weight: 500;
  color: #8da1b8; letter-spacing: .12em; text-transform: uppercase;
}
.side__nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #c3cede;
  transition: background .15s, color .15s;
}
.side__nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side__nav a.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.side__group {
  margin: 16px 12px 6px;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7b8fa6;
}

.main { flex: 1; min-width: 0; padding: 22px 28px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 20px; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__right form { margin: 0; }
.who { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------ 通用组件 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(22, 40, 61, .04);
}
.card--flush { padding: 0; overflow: hidden; }
.card h2 { margin: 0 0 10px; font-size: 15.5px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 0 0 10px; }
.hint--center { text-align: center; margin-top: 14px; }
.link { color: var(--accent); font-size: 13px; }
.link:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #2560d3; }
.btn--ghost { background: #fff; border-color: var(--line); color: #2b4159; }
.btn--ghost:hover { border-color: #b9cde3; background: #f8fbff; }
.btn--danger { background: #fdf1f0; border-color: #f4d2cf; color: var(--danger); }
.btn--danger:hover { background: #fbe5e3; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--block { width: 100%; }

.actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .hint { margin: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.inline { display: inline-flex; gap: 4px; margin: 0; }
.stack { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

.field { display: block; margin-bottom: 16px; }
.field > span, .field__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: #3c526b; margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="file"],
.field textarea,
.field select,
.copybox input,
.upload-row input,
.media figcaption input {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: #1f3348;
  background: #fbfcfe;
  border: 1px solid #dde7f2;
  border-radius: 9px;
  padding: 10px 12px;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 224, .12);
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input[type="file"] { background: #fff; padding: 7px 10px; font-size: 12.5px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #3c526b; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); }

.image-field { display: flex; gap: 14px; align-items: flex-start; }
.image-field__body { flex: 1; display: grid; gap: 8px; }
.thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f2f6fb; flex: none; }
.thumb--lg { width: 150px; height: 104px; border-radius: 10px; }

.copybox { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.copybox input { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f0f4f9;
  color: #71849a;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}
.badge--ok { background: #e7f7ee; color: var(--ok); margin-left: 0; }
.badge--warn { background: #fdf2e2; color: var(--warn); margin-left: 0; }

.flash { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; border: 1px solid; }
.flash--ok { background: #eaf8f1; border-color: #bfe7d2; color: #17734a; }
.flash--error { background: #fdf0ef; border-color: #f3cdc9; color: #a82c25; }
.flash--warn { background: #fdf6e9; border-color: #f1ddb5; color: #8c5d12; }
.flash-wrap { margin-bottom: 14px; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, transform .15s;
}
.stat:hover { border-color: #c3d7ee; transform: translateY(-2px); }
.stat__num { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1; }
.stat__label { font-size: 12.5px; color: var(--muted); }

.tips { margin: 0; padding-left: 18px; color: #4e6580; font-size: 13px; line-height: 1.9; }

/* ------------------------------------------------------------ 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid #eef3f9; }
.table th { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #7c8fa6; background: #fbfcfe; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.col-check { width: 36px; }
.col-order { width: 82px; }
.col-act { width: 150px; }
.cell { display: flex; align-items: center; gap: 10px; }
.cell strong { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.clamp { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  width: 26px; height: 26px;
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  cursor: pointer; color: #4e6580; font-size: 12px; line-height: 1;
}
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------ 媒体库 */
.upload-row { display: flex; gap: 10px; align-items: center; }
.upload-row input[type="file"] { max-width: 420px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.media { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fbfcfe; }
.media img { width: 100%; height: 100px; object-fit: cover; display: block; }
.media figcaption { padding: 8px; display: grid; gap: 6px; }
.media figcaption input { font-size: 11px; padding: 5px 7px; }
.media figcaption .btn { width: 100%; }

/* ------------------------------------------------------------ 登录页 */
.auth-body {
  display: grid; place-items: center; min-height: 100vh; padding: 30px 16px;
  background:
    radial-gradient(800px 400px at 50% -80px, #eaf2fd 0%, rgba(234, 242, 253, 0) 70%),
    #f4f6fa;
}
.auth-wrap { width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; font-size: 16px; font-weight: 700; color: var(--ink); }
.auth-brand small { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8da1b8; font-weight: 500; }
.auth .card { margin-bottom: 0; padding: 26px 26px 24px; }
.card--auth h2 { font-size: 18px; margin-bottom: 8px; }
.auth .hint { margin-bottom: 18px; }
.auth-foot { text-align: center; font-size: 11.5px; color: #93a4b8; margin-top: 16px; }
.qr { display: block; margin: 8px auto 14px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.secret { text-align: center; font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.codes { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 14px 0 18px; }
.codes li { background: #f5f8fd; border: 1px dashed #cfdff1; border-radius: 8px; padding: 10px; text-align: center; }
.codes code { background: none; font-size: 13.5px; letter-spacing: .06em; color: #22384f; }

@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: static; width: auto; height: auto; padding: 12px 10px; }
  .side__nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .side__nav a { padding: 7px 10px; font-size: 12.5px; }
  .side__group { width: 100%; margin: 10px 10px 2px; }
  .main { padding: 18px 16px 50px; }
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .image-field { flex-direction: column; }
  .thumb--lg { width: 100%; height: 160px; }
  .table .clamp { max-width: 180px; }
}
