:root {
  color-scheme: light;
  --bg: #f5f8fb;
  --panel: rgba(255, 255, 255, 0.92);
  --ink: #07111d;
  --muted: #5b6b7b;
  --line: rgba(150, 171, 188, 0.38);
  --accent: #007782;
  --accent-strong: #005b66;
  --red: #cf142b;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(0, 119, 130, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 87, 214, 0.04) 1px, transparent 1px),
    linear-gradient(140deg, #ffffff 0%, #eef7f8 46%, #f8fbff 100%);
  background-size: 38px 38px, 38px 38px, 100% 100%;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
}

.admin-hero {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
  margin-top: 8px;
}

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 253, 0.92));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 2.4vw, 26px);
  backdrop-filter: blur(16px) saturate(145%);
}

.login-panel {
  width: min(520px, 100%);
  margin: 56px auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 16px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: #233142;
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"] {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(0, 119, 130, 0.24);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  outline: 0;
  padding: 0 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input:focus {
  border-color: rgba(0, 119, 130, 0.74);
  box-shadow: 0 0 0 4px rgba(0, 119, 130, 0.11);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-row,
.period-row label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  padding: 10px 12px;
  font-weight: 700;
}

.check-row input,
.period-row input {
  accent-color: var(--accent);
}

.period-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.ghost-link,
.icon-btn {
  border: 1px solid rgba(0, 119, 130, 0.32);
  border-radius: 9px;
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.primary-btn {
  color: #ffffff;
  border-color: rgba(0, 119, 130, 0.64);
  background:
    linear-gradient(135deg, rgba(28, 184, 193, 0.95), rgba(0, 91, 102, 0.98)),
    var(--accent);
  box-shadow:
    0 16px 34px rgba(0, 119, 130, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.secondary-btn,
.ghost-btn,
.ghost-link,
.icon-btn {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 250, 0.84)),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.primary-btn::after,
.secondary-btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.38), transparent 42%, rgba(0, 119, 130, 0.12));
  opacity: 0.72;
  pointer-events: none;
}

.ghost-link {
  color: var(--accent-strong);
  font-weight: 800;
}

.icon-btn {
  width: 42px;
  padding: 0;
  color: var(--accent);
  font-size: 18px;
}

button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 119, 130, 0.56);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.13);
}

.primary-btn:hover {
  box-shadow:
    0 18px 38px rgba(0, 119, 130, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
  box-shadow: none;
}

.status-pill {
  min-width: 86px;
  text-align: center;
  border: 1px solid rgba(0, 119, 130, 0.24);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--accent-strong);
  background: rgba(0, 119, 130, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.warn {
  color: var(--red);
  background: rgba(207, 20, 43, 0.08);
  border-color: rgba(207, 20, 43, 0.22);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-card {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.status-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.status-card strong {
  font-size: 20px;
}

.status-log {
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #07111d;
  color: #d9f7f3;
  padding: 13px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(0, 119, 130, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 13px 15px;
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 860px) {
  .admin-grid,
  .field-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}
