:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #657085;
  --line: #dfe5ef;
  --primary: #116a7b;
  --primary-strong: #0b4f5d;
  --accent: #b36b00;
  --danger: #b42318;
  --sidebar: #202938;
  --sidebar-soft: #2d384a;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(17, 106, 123, 0.16), transparent 42%),
    linear-gradient(315deg, rgba(179, 107, 0, 0.14), transparent 44%),
    var(--bg);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 72px 20px 32px;
}

.language-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.08);
  z-index: 2;
}

.language-switch a {
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.language-switch a.is-active {
  color: #ffffff;
  background: var(--primary);
}

.login-card {
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.login-form label {
  color: var(--text);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.login-form button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
}

.login-form button:hover,
.button-link:hover {
  background: var(--primary-strong);
}

.form-error {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 6px;
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  padding: 22px;
  color: #ffffff;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.sidebar-nav a,
.sidebar-nav span {
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.76);
}

.sidebar-nav .is-active {
  color: #ffffff;
  background: var(--sidebar-soft);
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 64px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.96);
}

.language-switch.in-shell {
  position: static;
  box-shadow: none;
}

.ghost-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  cursor: pointer;
}

.content {
  padding: 32px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.overview-card {
  min-height: 180px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.overview-card p {
  color: var(--muted);
  line-height: 1.6;
}

.card-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-bottom: 18px;
  padding: 5px 9px;
  border-radius: 6px;
  color: var(--primary-strong);
  background: rgba(17, 106, 123, 0.1);
  font-size: 13px;
  font-weight: 700;
}

.notice,
.empty-state {
  margin: 12px 0 0;
  color: var(--muted);
}

.table-panel,
.form-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-panel {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

td {
  min-width: 120px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 180px;
}

.table-actions a,
.table-actions button {
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
}

.empty-state {
  padding: 20px;
}

.form-panel {
  display: grid;
  gap: 10px;
  max-width: 860px;
  padding: 22px;
}

.form-panel label {
  font-weight: 700;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.form-panel textarea {
  resize: vertical;
}

.field-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.code-hint {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fc;
  overflow-x: auto;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.form-actions,
.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.form-actions button {
  min-height: 40px;
  padding: 9px 16px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
}

.detail-panel {
  padding: 22px;
}

.section-gap {
  margin-top: 18px;
}

.panel-heading {
  padding: 18px 20px 0;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-toolbar select,
.panel-toolbar button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.panel-toolbar button {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
  cursor: pointer;
}

.filter-label {
  color: var(--muted);
  font-weight: 700;
}

.filter-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-links a {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
}

.filter-links a.is-active {
  color: #ffffff;
  border-color: var(--primary);
  background: var(--primary);
}

.inline-link {
  color: var(--primary);
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  overflow-wrap: anywhere;
  font-size: 24px;
}

.metric-card.is-payable {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.04);
}

.metric-card.is-payable strong {
  color: var(--danger);
}

.finance-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  align-items: end;
}

.finance-filter-grid label {
  align-self: center;
}

.finance-filter-grid input,
.finance-filter-grid select {
  width: 100%;
}

.embedded-form {
  max-width: 720px;
  padding: 0;
  border: 0;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
}

.pagination span {
  color: var(--muted);
  font-weight: 700;
}

.detail-panel dl {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px 18px;
  margin: 0;
}

.detail-panel dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-panel dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-panel pre {
  margin: 0;
  white-space: pre-wrap;
}

.inline-empty {
  padding: 0;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.screenshot-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.screenshot-card img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f0f3f8;
}

.screenshot-card figcaption {
  display: grid;
  gap: 4px;
  padding: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.screenshot-card figcaption strong {
  color: var(--text);
}

.review-screenshot {
  max-width: 980px;
}

.review-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.review-action-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.review-action-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.review-action-card label {
  color: var(--text);
  font-weight: 700;
}

.review-action-card input,
.review-action-card textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.review-action-card textarea {
  resize: vertical;
}

.review-action-card button {
  justify-self: start;
  min-height: 40px;
  padding: 9px 16px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
}

.review-action-card .danger-button {
  background: var(--danger);
}

.review-action-card .secondary-button {
  color: var(--text);
  border: 1px solid var(--line);
  background: #ffffff;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    justify-content: space-between;
    padding: 12px 18px;
  }

  .content {
    padding: 22px 18px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-panel dl {
    grid-template-columns: 1fr;
  }

  .review-action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .login-card {
    padding: 24px;
  }

  .language-switch {
    left: 12px;
    right: 12px;
    justify-content: center;
  }

  h1 {
    font-size: 24px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .finance-filter-grid {
    grid-template-columns: 1fr;
  }
}
