:root {
  --bg: #090909;
  --surface: #121211;
  --surface-soft: #181714;
  --surface-raised: #1d1b16;
  --text: #f2ead8;
  --muted: #a69c88;
  --line: #302b21;
  --line-bright: #51442b;
  --gold: #d8b35b;
  --gold-bright: #f3d98d;
  --gold-dark: #8d6924;
  --good: #9bdc9f;
  --good-bg: rgba(66, 133, 77, .18);
  --warn: #f2ca72;
  --warn-bg: rgba(177, 126, 25, .2);
  --danger: #ff8f83;
  --danger-bg: rgba(177, 55, 45, .18);
  --shadow: 0 16px 45px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse 48% 30% at 82% -8%, rgba(202, 159, 55, .11), transparent 70%),
    radial-gradient(ellipse 38% 28% at 5% 105%, rgba(129, 94, 27, .09), transparent 72%),
    var(--bg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: #fff2c9; text-decoration: underline; }
code {
  padding: 2px 6px;
  color: #e9d8a8;
  background: rgba(216, 179, 91, .09);
  border: 1px solid rgba(216, 179, 91, .13);
  border-radius: 5px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 {
  color: #f7e8bf;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.4px;
}
h2 { color: #f2e7cd; font-size: 19px; font-weight: 600; }
h3 { color: #f0e4c9; font-size: 16px; }
p { margin: 0; }
hr { margin: 22px 0; border: 0; border-top: 1px solid var(--line); }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px; padding: 0 30px;
  background: rgba(11, 11, 10, .91);
  border-bottom: 1px solid rgba(216, 179, 91, .22);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; color: #f4e8cd; font-size: 16px; font-weight: 650; letter-spacing: .02em; }
.brand:hover { color: #fff4d4; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid rgba(236, 205, 125, .46);
  border-radius: 9px;
  background: linear-gradient(145deg, #2d2619, #12110d);
  box-shadow: inset 0 1px 0 rgba(255, 236, 185, .1), 0 0 18px rgba(216, 179, 91, .08);
}
.topnav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--gold-bright); text-decoration: none; }
.container { max-width: 1120px; margin: 0 auto; padding: 36px 24px 76px; }
.footer { padding: 24px; color: #746b5b; font-size: 12px; text-align: center; letter-spacing: .03em; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; min-width: 0; }
.page-head > div { min-width: 0; }
.page-head h1 { margin-bottom: 5px; }
.page-head .muted { margin-top: 6px; }
.eyebrow { margin-bottom: 6px !important; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 15px; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); }
.hint { margin-top: 8px; color: #918674; font-size: 13px; }
.center { text-align: center; }

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(27, 26, 22, .96), rgba(17, 17, 15, .98));
  box-shadow: var(--shadow);
}
.group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.group-card {
  display: block; padding: 23px; color: var(--text);
  min-width: 0;
  border-color: #2d2921;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.group-card:hover {
  color: var(--text); text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(216, 179, 91, .54);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .45), 0 0 0 1px rgba(216, 179, 91, .08);
}
.group-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 15px; min-width: 0; }
.group-card-head > div { min-width: 0; }
.group-card h2 { margin-bottom: 3px; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.group-card code { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  color: #f8e5b1;
  background: radial-gradient(circle at 30% 22%, #8f7130, #2c2516 72%);
  border: 1px solid rgba(227, 193, 105, .42);
  box-shadow: inset 0 1px 0 rgba(255, 238, 190, .16);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px; font-weight: 700;
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.badge {
  display: inline-block; padding: 3px 9px;
  color: #b8ac93; background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge.good { color: var(--good); background: var(--good-bg); border-color: rgba(128, 210, 136, .16); }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: rgba(229, 182, 72, .18); }
.mini-stats { color: #918775; font-size: 13px; }
.punish-link { color: #c9ad6e; }
.group-card:hover .punish-link { color: #f0d693; text-decoration: underline; }
.empty { padding: 54px 24px; text-align: center; }
.empty h2 { margin: 10px 0; }
.empty .btn { margin-top: 18px; }
.empty-icon { color: var(--gold); font-size: 32px; }

.tabs {
  display: flex; gap: 3px; width: fit-content; max-width: 100%;
  margin-bottom: 19px; padding: 5px; overflow-x: auto;
  border: 1px solid #29251d; border-radius: 11px;
  background: rgba(22, 21, 18, .9);
}
.tabs a { padding: 8px 16px; border-radius: 8px; color: #9e9481; font-size: 14px; white-space: nowrap; }
.tabs a.active {
  color: #f4dfaa;
  background: linear-gradient(145deg, #2b261a, #211d14);
  border: 1px solid rgba(216, 179, 91, .24);
  box-shadow: 0 2px 9px rgba(0, 0, 0, .3);
  font-weight: 600;
}
.tabs a:hover { color: #f0dcae; text-decoration: none; }

.form { padding: 25px; }
.form.compact { margin-bottom: 18px; padding: 18px; }
.form .stack, .stack { display: flex; flex-direction: column; gap: 16px; }
.form > label, .form .grid-2 > label, .form .grid-3 > label { display: flex; flex-direction: column; gap: 7px; margin-bottom: 17px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
label > span:first-child { color: #d8cdb5; font-size: 13px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  color: #eee5d2;
  background: #0e0e0d;
  border: 1px solid #373128;
  border-radius: 8px;
  outline: none;
  font: inherit; font-size: 14px;
}
input::placeholder, textarea::placeholder { color: #686052; }
input:hover, select:hover, textarea:hover { border-color: #4c412d; }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 179, 91, .12);
}
select option { color: var(--text); background: #161512; }
textarea { resize: vertical; }
input[type=file] { padding: 8px; background: #11110f; }
input[type=date], input[type=time], input[type=datetime-local] { color-scheme: dark; }
input[type=checkbox] { width: auto; accent-color: var(--gold); }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: #c9bea8; font-size: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 16px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.card-head .muted { margin-top: 5px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.info-box {
  margin: 8px 0 18px; padding: 13px 16px;
  color: #b9ad93;
  background: linear-gradient(135deg, rgba(216, 179, 91, .055), rgba(255, 255, 255, .015));
  border: 1px solid rgba(216, 179, 91, .15);
  border-radius: 9px;
  font-size: 13px;
}
.info-box strong { color: #dfca96; }
.info-box ul { margin: 5px 0 0; padding-left: 20px; }

.btn {
  display: inline-block; padding: 9px 17px;
  border: 1px solid transparent; border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 650;
  cursor: pointer; white-space: nowrap;
  transition: filter .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn.primary {
  color: #171309;
  background: linear-gradient(135deg, #e1c472, #c99e43);
  border-color: #ead38c;
  box-shadow: inset 0 1px 0 rgba(255, 247, 208, .38), 0 5px 18px rgba(176, 128, 31, .14);
}
.btn.primary:hover { filter: brightness(1.08); color: #171309; }
.btn.ghost { color: #d5c6a8; background: #171612; border-color: #3b3325; }
.btn.ghost:hover { background: #201d16; border-color: #665231; }
.btn.danger { color: #ffad9f; background: rgba(128, 35, 28, .12); border-color: rgba(206, 91, 75, .32); }
.btn.danger:hover { background: rgba(128, 35, 28, .22); }
.btn.small { padding: 5px 11px; font-size: 12px; }
.link-btn { padding: 0; color: var(--muted); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.link-btn:hover { color: var(--gold-bright); }
.inline { display: inline; }

.stack-list { display: flex; flex-direction: column; gap: 10px; }
.row-card { display: flex; align-items: center; gap: 15px; padding: 15px 18px; color: var(--text); }
.row-card:hover { color: var(--text); text-decoration: none; border-color: rgba(216, 179, 91, .4); }
.row-main { flex: 1; min-width: 0; }
.row-main h3 { margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; }
.row-main p { font-size: 13px; }
.ad-thumb {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 9px;
  background: #1c1a15; border: 1px solid #322c20; font-size: 20px;
}
.keyword-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.keyword-row .response { color: #bdb19a; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.keyword-row h3 code { font-size: 14px; }

.switch { position: relative; display: inline-block; flex: none; width: 42px; height: 24px; }
.switch input { width: 0; height: 0; opacity: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  border: 1px solid #40382a; border-radius: 20px;
  background: #27231b; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; left: 3px; bottom: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #a49882; transition: .2s;
}
.switch input:checked + .slider { background: linear-gradient(90deg, #87651f, #d4ac4d); border-color: #d5b461; }
.switch input:checked + .slider::before { background: #fff2c5; transform: translateX(18px); }

.flash { margin-bottom: 18px; padding: 12px 16px; border-radius: 9px; font-size: 14px; }
.flash.ok { color: var(--good); background: var(--good-bg); border: 1px solid rgba(128, 210, 136, .18); }
.flash.err { color: var(--danger); background: var(--danger-bg); border: 1px solid rgba(212, 102, 89, .25); }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: #918773; font-size: 13px; }
.crumbs span { color: #5c5447; }

.auth-card {
  max-width: 410px; margin: 76px auto; padding: 34px;
  background: linear-gradient(150deg, rgba(29, 27, 22, .97), rgba(14, 14, 13, .99));
  border: 1px solid rgba(216, 179, 91, .23);
  border-radius: 16px;
  box-shadow: 0 24px 65px rgba(0, 0, 0, .52), 0 0 0 1px rgba(216, 179, 91, .04);
}
.auth-card h1 { margin-bottom: 6px; font-size: 26px; }
.auth-card .muted { margin-bottom: 22px; font-size: 14px; }
.auth-card .hint { margin-top: 18px; line-height: 1.65; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #b3a78e; background: rgba(216, 179, 91, .035); font-size: 12px; font-weight: 600; }
td { color: #d7cdb9; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(216, 179, 91, .025); }

@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .container { padding: 24px 14px 60px; }
  .group-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 24px; }
  .form { padding: 18px; }
  .keyword-row { flex-wrap: wrap; }
  .tabs { width: 100%; }
  .tabs a { flex: 1; padding-right: 8px; padding-left: 8px; text-align: center; }
  .page-head h1, .crumbs { overflow-wrap: anywhere; }
}
