:root {
  --teal: #0f9f91;
  --teal-dark: #087a72;
  --ink: #123157;
  --muted: #587195;
  --line: #c7ebe7;
  --soft: #effdfb;
  --card: #ffffff;
  --danger: #c23b48;
  --shadow: 0 18px 55px rgba(20, 92, 108, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 10%, rgba(185, 255, 231, 0.8), transparent 36%),
    radial-gradient(circle at 100% 0%, rgba(230, 248, 255, 0.95), transparent 42%),
    linear-gradient(135deg, #e9fff7 0%, #eefaff 58%, #f9fffd 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  min-height: 46px;
  padding: 0 22px;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--teal-dark);
}

button:disabled,
.mode.disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfffe;
  color: var(--ink);
  outline: none;
  padding: 14px 16px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #53cec3;
  box-shadow: 0 0 0 3px rgba(83, 206, 195, 0.16);
}

.shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 80px;
}

.hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero.compact {
  margin-bottom: 24px;
}

.hero-mark {
  display: inline-block;
  margin-right: 22px;
  font-size: clamp(40px, 5vw, 62px);
  vertical-align: middle;
}

.hero h1 {
  display: inline-block;
  margin: 0;
  color: #07877e;
  font-size: clamp(44px, 5.2vw, 70px);
  letter-spacing: 0;
  vertical-align: middle;
}

.hero p {
  margin: 18px 0 0;
  color: #233f69;
  font-size: 18px;
  letter-spacing: 0;
}

.card {
  background: var(--card);
  border: 1px solid #d2e7e4;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto 26px;
  padding: clamp(24px, 3vw, 38px);
}

.input-card {
  max-width: 1060px;
}

.card h2 {
  color: #07877e;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 24px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.input-row input {
  min-height: 54px;
  font-size: 18px;
}

.status-line {
  color: #274776;
  font-weight: 700;
  margin: 18px 0 0;
}

.error-line {
  color: var(--danger);
  font-weight: 800;
  margin: 12px 0 0;
}

.hidden {
  display: none !important;
}

.language-switch {
  position: fixed;
  z-index: 20;
  top: 24px;
  right: 32px;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #b9d8d4;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(9, 95, 102, 0.16);
}

.language-switch button {
  min-height: 44px;
  border-radius: 0;
  background: #f7fffe;
  color: var(--teal-dark);
  padding: 0 18px;
}

.language-switch button.active {
  background: #16b7a9;
  color: #fff;
}

.staging-badge {
  position: fixed;
  top: 84px;
  right: 32px;
  z-index: 19;
  display: grid;
  gap: 2px;
  min-height: auto;
  max-width: 220px;
  padding: 10px 14px;
  border: 1px solid #f0c66b;
  border-radius: 8px;
  background: #fff8e7;
  color: #7a4d00;
  box-shadow: 0 12px 30px rgba(122, 77, 0, 0.14);
}

.staging-badge small {
  display: none;
  color: #7a4d00;
  font-weight: 600;
}

.staging-badge.expanded small {
  display: block;
}

.admin-badge {
  top: 22px;
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.mode {
  background: #eafffb;
  color: var(--teal-dark);
  border: 1px solid #9be1da;
}

.mode.active {
  background: var(--teal);
  color: #fff;
}

.task-head,
.section-head,
.console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  background: #e8f8f5;
  color: var(--teal-dark);
  font-weight: 800;
  padding: 0 14px;
}

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

.field-box {
  border: 1px solid #d8ece9;
  border-radius: 8px;
  background: #fbfffe;
  padding: 18px;
}

.field-box label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
}

.field-box strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  overflow-wrap: anywhere;
}

.field-box small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}

.ghost,
.secondary {
  background: #eef9f8;
  color: var(--teal-dark);
}

.ghost {
  margin-top: 14px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  align-items: center;
}

.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #d8ece9;
  border-radius: 8px;
  background: #f8fffd;
  padding: 18px 20px;
}

#latest-code {
  color: #096f68;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.history-item {
  border: 1px solid #e0eeee;
  border-radius: 8px;
  background: #fbfffe;
  padding: 12px 14px;
}

.admin-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 80px;
}

.login-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.login-card input {
  display: block;
  width: 100%;
  margin-bottom: 14px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 16px;
}

.console-head h1 {
  color: #07877e;
  margin: 0 0 8px;
}

.console-head p {
  margin: 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.stat-card {
  background: #fff;
  border: 1px solid #d2e7e4;
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-card span {
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  display: block;
  color: #07877e;
  font-size: 28px;
  margin-top: 8px;
}

.admin-section {
  max-width: none;
}

.admin-section textarea,
.filters input,
.filters select {
  width: 100%;
}

.filters {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 150px auto;
  gap: 10px;
  min-width: min(100%, 560px);
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e0eeee;
  border-radius: 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 920px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid #e7f0ef;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #087a72;
  background: #f3fffd;
  font-weight: 900;
}

td {
  color: #203a61;
}

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

.row-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.setting-item {
  border: 1px solid #e0eeee;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfffe;
}

@media (max-width: 820px) {
  .shell,
  .admin-shell {
    width: min(100% - 24px, 100%);
    padding-top: 84px;
  }

  .language-switch,
  .staging-badge {
    right: 12px;
  }

  .input-row,
  .grid-two,
  .filters,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .task-head,
  .section-head,
  .console-head,
  .code-box {
    display: grid;
  }
}

