:root {
  --navy: #0b192e;
  --navy-deep: #071222;
  --navy-mid: #122a4a;
  --card: #ffffff;
  --text: #0b192e;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --ok: #059669;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 24px 48px rgba(7, 18, 34, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body.page-shell {
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #1a3a5c 0%, var(--navy) 45%, var(--navy-deep) 100%);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand img {
  height: 44px;
  width: auto;
  display: inline-block;
  margin-bottom: 16px;
}

.brand-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.wrap-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 36px 40px 40px;
  box-shadow: var(--shadow-card);
  border: none;
}

.card-auth {
  width: 100%;
  max-width: 420px;
}

.card-panel {
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(7, 18, 34, 0.12);
}

h1 { font-size: 22px; margin: 0 0 8px; color: var(--navy); }
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--navy);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.muted { color: var(--muted); }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(7, 18, 34, 0.15);
}

.site-header .brand-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.site-header .brand-inline img {
  height: 36px;
  margin: 0;
}

.site-header .brand-inline h1 {
  font-size: 18px;
  margin: 0;
}

.site-header .brand-inline .brand-sub {
  font-size: 12px;
  margin-top: 2px;
}

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

input, button, select { font: inherit; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-right: 40px;
}

.input-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.input-toggle:hover { color: var(--navy); background: transparent; }

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  margin: 16px 0 8px;
}

label:first-of-type { margin-top: 0; }

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
}

.remember-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--navy);
}

button, .btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  padding: 11px 20px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}

button:hover, .btn:hover { background: var(--navy-mid); }

button.primary { background: var(--navy); width: 100%; margin-top: 8px; }

button.ghost, .btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

button.ghost:hover { background: #f8fafc; }

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

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

button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }

button:disabled { opacity: 0.55; cursor: not-allowed; }

.err { color: var(--danger); margin: 12px 0 0; font-size: 14px; }
.ok { color: var(--ok); }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  word-break: break-all;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: none;
}

.progress {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #3b82f6);
  width: 0;
  transition: width 0.2s;
}

.hidden { display: none !important; }

.field { max-width: 100%; }

.actions button { margin: 0 6px 8px 0; font-size: 13px; padding: 8px 12px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 18, 34, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  max-width: 460px;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  animation: slideUp 0.22s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-head {
  padding: 22px 28px 20px;
  border-bottom: none;
  background: var(--navy);
}

.modal-head h2 {
  border: none;
  padding: 0;
  margin: 0 0 6px;
  font-size: 18px;
  color: #f8fafc;
}

.modal-head p {
  margin: 0;
  font-size: 13px;
  color: rgba(248, 250, 252, 0.78);
  line-height: 1.5;
}

.modal-body {
  padding: 20px 28px 8px;
  background: #fff;
}

.modal-section {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.modal-section:last-of-type {
  margin-bottom: 0;
}

.modal-section label {
  margin-top: 0;
}

.modal-section label + .form-grid label,
.modal-section .form-grid label {
  margin-top: 0;
}

.modal-body label {
  margin-top: 14px;
}

.modal-body > .modal-section label:first-child {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.pwd-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.pwd-row input {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  font-size: 15px;
}

.btn-sm {
  padding: 0 14px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-sm.ghost {
  min-width: 72px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  min-width: 42px;
  border-radius: 8px;
  color: var(--navy);
}

.icon-btn:hover {
  color: var(--accent);
  background: #fff;
}

.icon-btn svg {
  display: block;
}

.modal-foot {
  display: flex;
  gap: 10px;
  padding: 16px 28px 24px;
}

.modal-foot button {
  flex: 1;
}

.modal-foot button.primary-modal {
  background: var(--navy);
}

.hint-inline {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

.file-input-row input[type="file"] {
  flex: 1;
  min-width: 200px;
  padding: 8px;
  font-size: 14px;
}

.file-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

@media (max-width: 640px) {
  .card { padding: 28px 22px 32px; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .actions button { display: block; width: 100%; margin-right: 0; }
}
