:root {
  --black: #000000;
  --deep-blue: #054163;
  --blue: #0099d8;
  --light-blue: #e2eef8;
  --silver: #ededed;
  --white: #ffffff;

  --bg: #f6fafd;
  --surface: var(--white);
  --surface-2: #f8fbfe;
  --surface-3: var(--light-blue);
  --ink: #071b29;
  --muted: #647684;
  --line: #d8e4ed;
  --line-strong: #b7cfde;
  --accent: var(--deep-blue);
  --accent-2: var(--blue);
  --warn: #a16207;
  --danger: #b42318;
  --danger-bg: #fff5f3;
  --shadow: 0 16px 40px rgba(5, 65, 99, 0.09);
  --shadow-soft: 0 8px 22px rgba(5, 65, 99, 0.06);
  --radius: 8px;
  font-family: "Segoe UI", "Microsoft YaHei UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
.file-action,
.sso-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--white);
  color: var(--deep-blue);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 10px 14px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover,
.file-action:hover,
.sso-button:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 16px rgba(0, 153, 216, 0.13);
  transform: translateY(-1px);
}

button:active,
.file-action:active,
.sso-button:active {
  transform: translateY(0);
}

.primary {
  background: var(--deep-blue);
  border-color: var(--deep-blue);
  color: var(--white);
}

.primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 10px 20px rgba(0, 153, 216, 0.22);
}

.secondary {
  background: var(--light-blue);
  border-color: #b9d5e8;
  color: var(--deep-blue);
}

.secondary:hover {
  background: #d4e8f6;
}

.sso-button {
  text-decoration: none;
}

.ghost {
  background: transparent;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  padding: 10px 11px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea {
  min-height: 66px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 153, 216, 0.16);
}

.invalid-field {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.13) !important;
}

.field-stack {
  display: grid;
  gap: 6px;
}

.field-help {
  color: #526b7b;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 390px);
  gap: 34px;
  width: min(900px, 100%);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
}

.login-panel > div:first-child {
  display: grid;
  align-content: center;
  min-height: 360px;
  background: var(--deep-blue);
  color: var(--white);
  padding: 42px;
}

.login-panel > div:first-child .eyebrow {
  color: #9dd9f3;
}

.login-panel > div:first-child .muted {
  color: #c8deeb;
}

.login-panel h1,
.brand h1,
.topbar h2,
.section-head h3 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h1 {
  max-width: 420px;
  font-size: 34px;
  line-height: 1.16;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 42px 42px 42px 0;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.app-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  align-content: start;
  gap: 18px;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--deep-blue);
  color: var(--white);
  padding: 24px 22px;
  box-shadow: 10px 0 28px rgba(5, 65, 99, 0.12);
}

.sidebar label {
  color: #c9e1ee;
}

.sidebar input,
.sidebar select {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.96);
  color: var(--deep-blue);
  font-weight: 700;
}

.sidebar .primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.sidebar .primary:hover {
  background: #00a8ed;
  border-color: #00a8ed;
}

.sidebar .ghost {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
}

.sidebar .ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.46);
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: var(--white);
  color: var(--deep-blue);
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.brand h1 {
  color: var(--white);
  font-size: 20px;
}

.brand p {
  margin: 5px 0 0;
  color: #c7dfed;
  font-size: 13px;
  line-height: 1.35;
}

.side-note {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 18px;
  color: #c7dfed;
  font-size: 13px;
}

.side-note strong {
  color: var(--white);
}

.retention-note span {
  line-height: 1.55;
}

.workspace {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.topbar h2 {
  color: var(--deep-blue);
  font-size: 25px;
  line-height: 1.25;
}

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

.file-action {
  color: var(--deep-blue);
}

.file-action input {
  display: none;
}

.message {
  border: 1px solid #abd3e6;
  border-radius: var(--radius);
  background: var(--light-blue);
  color: var(--deep-blue);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 650;
}

.message.warn {
  border-color: #e4c580;
  background: #fff8e8;
  color: var(--warn);
}

.section-band {
  display: grid;
  gap: 13px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--deep-blue);
  font-size: 18px;
}

.section-head h3::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--blue);
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
}

.info-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  border-left: 4px solid var(--blue);
  border-radius: 7px;
  background: var(--light-blue);
  padding: 12px 13px;
}

.info-item span {
  color: #466476;
  font-size: 12px;
  font-weight: 800;
}

.info-item strong {
  color: var(--deep-blue);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.table-host {
  min-width: 0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--light-blue);
  color: var(--deep-blue);
  font-size: 12px;
  font-weight: 850;
}

.data-table thead th:first-child {
  border-top-left-radius: 7px;
}

.data-table thead th:last-child {
  border-top-right-radius: 7px;
}

.data-table tbody tr:not(.row-error-row):hover td {
  background: #fbfdff;
}

.data-table td:first-child,
.data-table th:first-child {
  width: 52px;
  text-align: center;
}

.data-table input,
.data-table textarea {
  border-color: #dbe8f0;
  background: var(--white);
}

.data-table input:hover,
.data-table textarea:hover {
  border-color: #c6d9e6;
}

.data-table tr.row-invalid > td {
  border-bottom-color: transparent;
}

.data-table .row-error-row td {
  border-bottom: 1px solid var(--line);
  padding: 0 8px 10px;
}

.row-error {
  border: 1px solid #f0b7ae;
  border-radius: 7px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
  padding: 9px 11px;
}

.row-action {
  width: 38px;
  min-height: 36px;
  padding-inline: 0;
  color: var(--danger);
}

.row-action:hover {
  border-color: #f0b7ae;
  background: var(--danger-bg);
  box-shadow: none;
}

.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.two-col > div {
  min-width: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.photo-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.photo-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 7px;
  background: var(--silver);
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  .info-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .login-panel {
    grid-template-columns: 1fr;
  }

  .login-panel > div:first-child {
    min-height: auto;
  }

  .login-form {
    padding: 0 28px 28px;
  }
}
