:root {
  color-scheme: light;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --ink: #17202a;
  --muted: #65758a;
  --line: #d7dee8;
  --accent: #176b87;
  --accent-strong: #0f536a;
  --gold: #d89b28;
  --green: #3d8067;
  --danger: #b42318;
  --shadow: 0 16px 36px rgba(18, 31, 45, 0.18);
  --card-opacity: 0.9;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #1f3440;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("/assets/site-background-fc100-m400.png?v=20260707-7") center / cover no-repeat;
  content: "";
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 25, 34, 0.36), rgba(10, 25, 34, 0.2) 34%, rgba(238, 242, 246, 0.82)),
    rgba(11, 25, 35, 0.14);
  content: "";
}

.search-box {
  position: static;
  z-index: 2;
  display: grid;
  grid-template-columns: 118px minmax(220px, 460px) 88px;
  gap: 8px;
  align-items: center;
  width: min(760px, calc(100vw - 48px));
  margin: 0 auto;
}

.search-box select,
.search-box input,
.search-box button {
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 6px;
  font: inherit;
}

.search-box select,
.search-box input {
  color: #ffffff;
  background: rgba(11, 25, 35, 0.38);
  box-shadow: 0 8px 22px rgba(10, 32, 45, 0.16);
  backdrop-filter: blur(8px);
}

.search-box select {
  padding: 0 10px;
}

.search-box input {
  padding: 0 13px;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.search-box button {
  color: #fff;
  background: rgba(23, 107, 135, 0.94);
  cursor: pointer;
  font-weight: 800;
}

.search-box button:hover {
  background: var(--accent-strong);
}

.center-status {
  position: static;
  z-index: 2;
  width: min(620px, calc(100vw - 48px));
  margin: clamp(210px, 31vh, 340px) auto 0;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
}

.time-readout {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: min(520px, 100%);
  padding: 8px 18px 10px;
  color: #ffffff;
  background: rgba(11, 25, 35, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(10, 32, 45, 0.16);
  backdrop-filter: blur(4px);
  font-variant-numeric: tabular-nums;
}

#beijingTime {
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 800;
  line-height: 1;
}

.milliseconds {
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 800;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.status-chip {
  min-width: 0;
  padding: 10px 12px;
  background: rgba(11, 25, 35, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(10, 32, 45, 0.12);
  backdrop-filter: blur(6px);
}

.status-chip span,
.status-chip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.status-chip strong {
  margin-top: 5px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #d6f0f6;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

h1 {
  margin: 0;
  color: #ffffff;
  font-size: 34px;
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

main {
  display: grid;
  position: relative;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 44px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
}

.hero-nav {
  padding: 0 0 22px;
  align-content: start;
}

.more-nav {
  padding: 0 0 20px;
}

.service-card {
  display: grid;
  grid-template-rows: 150px 1fr;
  min-height: 248px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid rgba(220, 229, 239, 0.72);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(18, 31, 45, 0.13);
  opacity: var(--card-opacity);
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.service-card:hover,
.service-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(23, 107, 135, 0.75);
  box-shadow: var(--shadow);
  outline: none;
}

.card-media {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--green) 55%, var(--gold));
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fallback-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
}

.card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
}

.card-title {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.3;
}

.card-description {
  min-height: 22px;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.icon-button,
.plain-button,
.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: rgba(23, 107, 135, 0.94);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(10, 32, 45, 0.28);
}

.icon-button:hover {
  background: var(--accent-strong);
}

.admin-dialog {
  width: min(960px, calc(100% - 28px));
  max-height: min(88vh, 880px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-dialog::backdrop {
  background: rgba(15, 27, 39, 0.5);
}

.login-panel,
.settings-panel {
  padding: 24px;
  background: var(--panel-solid);
}

.settings-panel {
  max-height: min(88vh, 880px);
  overflow: auto;
}

.dialog-head,
.card-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-head {
  margin-bottom: 18px;
}

.dialog-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.plain-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  color: var(--muted);
  background: transparent;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.plain-button:hover {
  color: var(--ink);
  background: #eef2f6;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}

input[type="file"] {
  padding: 8px 10px;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 107, 135, 0.15);
}

select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 107, 135, 0.15);
}

.settings-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 220px) 150px 170px auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.toggle-setting {
  align-items: center;
}

.toggle-setting input {
  width: 22px;
  height: 22px;
  justify-self: start;
  padding: 0;
}

.opacity-setting span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.opacity-setting output {
  color: var(--accent-strong);
  font-weight: 800;
}

.add-card-button {
  margin-bottom: 14px;
}

.card-editor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card-editor {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.card-editor h3 {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 16px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: -2px 0 14px;
}

.message {
  min-height: 22px;
  margin: 10px 0;
  color: #b54708;
  font-size: 14px;
}

.message.success {
  color: #087443;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  color: var(--accent-strong);
  background: #e7f0f3;
}

.secondary-button:hover {
  background: #d9e8ed;
}

.danger-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--danger);
  background: #fff1f0;
}

.danger-button:hover {
  background: #ffe2de;
}

.hidden {
  display: none;
}

@media (max-height: 820px), (max-width: 760px) {
  main {
    gap: 18px;
  }

  .center-status {
    width: min(680px, 100%);
    margin: clamp(72px, 15vh, 130px) auto 0;
  }

  .search-box {
    width: min(760px, 100%);
    margin: 0 auto;
  }

  .hero-nav {
    padding: 0 0 26px;
  }
}

@media (max-width: 880px) {
  .nav-grid,
  .card-editor-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-controls {
    grid-template-columns: 1fr 150px;
  }

  .add-card-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .topbar,
  main {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    padding-top: 24px;
  }

  h1 {
    font-size: 28px;
  }

  .search-box {
    grid-template-columns: 1fr;
    width: min(100%, 420px);
  }

  .center-status {
    width: min(100%, 420px);
  }

  .time-readout {
    min-width: 0;
    width: 100%;
  }

  .status-row {
    grid-template-columns: 1fr 1fr;
  }

  .status-chip {
    padding: 9px 10px;
  }

  .status-chip:last-child {
    grid-column: 1 / -1;
  }

  .nav-grid,
  .card-editor-list,
  .settings-controls,
  .upload-row {
    grid-template-columns: 1fr;
  }

  .service-card {
    grid-template-rows: 128px 1fr;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }
}
