* { box-sizing: border-box; }
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --pending-bg: #fef3c7;
  --pending-text: #92400e;
  --danger: #dc2626;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}
body {
  margin: 0;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}
.container {
  max-width: 1360px;
  margin: 28px auto;
  padding: 0 18px 40px;
}
.card, .login-card, .app-shell {
  background: var(--panel);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card {
  padding: 20px;
  margin-bottom: 18px;
}
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-shell {
  width: 100%;
  max-width: 1020px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
}
.login-hero {
  padding: 46px;
  background: radial-gradient(circle at top left, #dbeafe 0%, #eff6ff 35%, #f8fbff 100%);
  border-right: 1px solid var(--line);
}
.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}
.login-hero h1, .page-title {
  margin: 18px 0 10px;
  font-size: 34px;
  line-height: 1.15;
}
.hero-text, .subtext {
  color: var(--muted);
  line-height: 1.7;
}
.hero-points {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.hero-points li {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(219, 234, 254, 0.9);
}
.login-panel {
  padding: 42px 36px;
}
.login-form, .toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.login-form {
  flex-direction: column;
  margin-top: 18px;
}
input[type="text"], input[type="password"], input[type="file"], input[type="date"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d7dce5;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform .12s ease, background .18s ease;
}
button:hover { transform: translateY(-1px); background: var(--primary-dark); }
button.secondary { background: #64748b; }
button.danger { background: var(--danger); }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.page-subtitle, .hint {
  color: var(--muted);
}
.app-shell {
  overflow: hidden;
}
.app-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.user-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: #334155;
  font-size: 13px;
}
.toolbar-card {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fcfdff;
}
.toolbar-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar-row:last-child { margin-bottom: 0; }
.inline-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--panel-soft);
}
.mode-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 13px;
}
.table-card {
  padding: 18px 20px 20px;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid #eceff4;
  text-align: left;
  vertical-align: top;
  background: #fff;
}
th {
  background: #f8fafc;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
th:last-child, td:last-child {
  min-width: 120px;
  position: sticky;
  right: 0;
  z-index: 2;
  box-shadow: -10px 0 16px rgba(15, 23, 42, 0.05);
}
th:last-child { z-index: 3; }
.thumb-image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d7dce5;
  display: block;
}
.no-image { color: #94a3b8; }
.status-badge, .claim-badge, .readonly-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status-pending { background: var(--pending-bg); color: var(--pending-text); }
.status-added { background: var(--success-bg); color: var(--success-text); }
.claim-badge { margin-left: 6px; background: #dbeafe; color: #1d4ed8; }
.readonly-badge { background: #e2e8f0; color: #475569; }
.empty {
  padding: 28px 0 12px;
  color: var(--muted);
  display: none;
  text-align: center;
}
.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
}
.message {
  margin-top: 10px;
  min-height: 20px;
  color: #0f172a;
}
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  padding: 24px 0;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.modal-panel {
  position: relative;
  z-index: 1;
  max-width: 760px;
  max-height: calc(100vh - 48px);
  margin: 40px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.modal-header, .modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.modal-body {
  margin: 18px 0;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}
.form-block { margin-bottom: 14px; }
.form-block label { display: block; margin-bottom: 8px; font-weight: 700; }
.meta-box {
  min-height: 42px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #d7dce5;
  border-radius: 12px;
  color: #334155;
}
.edit-image-preview {
  min-height: 120px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}
.edit-image-preview.empty { color: #94a3b8; }
.preview-image { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; }
.active-added-filter {
  background: var(--primary-dark) !important;
  color: #fff !important;
}
.fresh-updated-row td { background: #ecfdf5 !important; }
@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-hero {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 768px) {
  .container {
    padding: 0 12px 32px;
  }
  .toolbar, .toolbar-actions, .toolbar-row {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-filter-label {
    flex-direction: column;
    align-items: flex-start;
  }
  input[type="text"], input[type="password"], input[type="file"], input[type="date"], select, textarea, button {
    width: 100%;
  }
  .app-header {
    padding: 18px;
  }
  .toolbar-card, .table-card {
    padding: 16px;
  }
  .modal-panel {
    margin: 20px 12px;
  }
}
