:root {
  color-scheme: light;
  --ink: #14231d;
  --muted: #66736e;
  --paper: #f7f8f4;
  --card: #fff;
  --line: #dfe5df;
  --green: #1f6a4c;
  --green-dark: #174f3a;
  --mint: #dceee4;
  --sand: #ece8dc;
  --danger: #9c3f35;
  --danger-bg: #f9e8e5;
  --shadow: 0 24px 70px rgba(27, 52, 41, .09);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }

.public-page {
  background:
    radial-gradient(circle at 12% 14%, rgba(222, 238, 228, .85), transparent 29rem),
    linear-gradient(135deg, #f8f8f4 0%, #f4f6f1 100%);
  display: flex; flex-direction: column;
}
.public-page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .38;
  background-image: linear-gradient(rgba(20,35,29,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(20,35,29,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.public-shell {
  width: min(1040px, calc(100% - 40px)); margin: auto;
  padding: 64px 0 36px; display: grid; grid-template-columns: 1fr 480px;
  gap: clamp(48px, 8vw, 110px); align-items: center; position: relative;
}
.brand-block { max-width: 430px; }
.eyebrow {
  color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .18em;
  margin: 0 0 18px; text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 { font-family: "STSong", "SimSun", serif; font-size: clamp(48px, 7vw, 78px); line-height: 1; letter-spacing: -.04em; margin-bottom: 24px; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.8; }
.card {
  background: rgba(255,255,255,.92); border: 1px solid rgba(217,226,218,.9);
  border-radius: 20px; box-shadow: var(--shadow);
}
.form-card { padding: 34px; }
.card-heading { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 28px; }
.card-heading .step {
  display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 50%; background: var(--mint); color: var(--green); font-size: 11px; font-weight: 800;
}
.card-heading h2, .panel h2 { font-size: 20px; margin: 0 0 5px; }
.card-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.stack-form { display: grid; gap: 19px; }
.stack-form label, .compact-form label { display: grid; gap: 8px; }
.stack-form label > span, .compact-form label > span { font-size: 13px; font-weight: 700; }
input {
  width: 100%; border: 1px solid #d6ddd7; background: #fbfcfa; color: var(--ink);
  border-radius: 10px; min-height: 48px; padding: 0 14px; outline: none; transition: .18s ease;
}
input::placeholder { color: #a0aaa5; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,106,76,.11); background: white; }
.button {
  appearance: none; border: 0; border-radius: 10px; min-height: 48px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 750; text-decoration: none; cursor: pointer; transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .65; cursor: wait; transform: none; }
.button-primary { background: var(--green); color: white; box-shadow: 0 8px 24px rgba(31,106,76,.16); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { border: 1px solid var(--line); background: white; color: var(--ink); }
.alert { padding: 12px 14px; border-radius: 9px; background: var(--sand); color: #5d584b; margin: 0 0 20px; font-size: 13px; line-height: 1.6; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.notice-row { display: flex; gap: 11px; border-top: 1px solid var(--line); margin-top: 26px; padding-top: 20px; }
.notice-mark { display: grid; place-items: center; flex: 0 0 20px; height: 20px; background: var(--sand); border-radius: 50%; font-size: 12px; font-weight: 800; }
.notice-row p, .fine-print { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0; }
footer { position: relative; text-align: center; color: #8b948f; font-size: 12px; padding: 0 20px 28px; }

.success-shell { grid-template-columns: .9fr 1.1fr; }
.download-card { padding: 42px; display: grid; gap: 24px; }
.success-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--green); font-size: 22px; font-weight: 800; }
.file-label { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; margin-bottom: 8px; }
.download-card h2 { font-size: 24px; margin: 0 0 8px; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: 13px; margin: 0; }
.download-button { width: 100%; min-height: 54px; }

.admin-login-page { display: grid; place-items: center; background: var(--paper); padding: 30px; }
.login-shell { width: min(430px, 100%); padding: 42px; }
.login-shell h1 { font-size: 40px; margin-bottom: 12px; }
.login-shell .lead { font-size: 15px; margin-bottom: 28px; }
.text-link { display: block; text-align: center; margin-top: 22px; color: var(--muted); font-size: 13px; }

.admin-page { background: #f5f6f2; }
.admin-header {
  height: 70px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex;
  align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(12px);
}
.admin-brand { font-weight: 800; text-decoration: none; }.admin-brand span { color: var(--muted); font-weight: 500; }
.admin-header nav { display: flex; align-items: center; gap: 20px; font-size: 13px; }
.admin-header nav a { text-decoration: none; color: var(--muted); }
.admin-header nav form { margin: 0; }
.link-button { border: 0; background: none; padding: 0; color: var(--danger); cursor: pointer; }
.admin-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 70px; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 26px; }
.dashboard-heading h1 { font-family: inherit; font-size: 32px; letter-spacing: -.03em; margin: 0; }
.dashboard-heading .eyebrow, .panel .eyebrow { margin-bottom: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: white; }
.stat-card span { color: var(--muted); font-size: 12px; display: block; margin-bottom: 13px; }
.stat-card strong { font-size: 32px; letter-spacing: -.04em; }
.stat-card.accent { background: var(--green); color: white; border-color: var(--green); }
.stat-card.accent span { color: rgba(255,255,255,.72); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-bottom: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; }
.package-line { display: flex; gap: 13px; align-items: center; padding: 14px; background: var(--paper); border-radius: 10px; margin-bottom: 18px; }
.file-chip { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--mint); color: var(--green); font-size: 10px; font-weight: 900; }
.package-line strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.package-line span { color: var(--muted); font-size: 11px; }
.compact-form { display: grid; gap: 11px; }
.manual-add-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.file-input { border: 1px dashed #cbd5cd; padding: 13px; border-radius: 9px; background: #fbfcfa; }
.file-input input { border: 0; padding: 4px 0 0; min-height: 0; background: transparent; font-size: 12px; }
.helper, .muted { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
.users-heading { gap: 24px; }
.users-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: 1; flex-wrap: wrap; }
#bulk-delete-form { display: flex; gap: 8px; }
.button-mini { border: 0; border-radius: 8px; padding: 10px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.button-mini.danger { background: #fff1f1; color: var(--danger); border: 1px solid #ffd7d7; }
.search-form { display: flex; gap: 8px; width: min(420px, 50%); }
.users-tools .search-form { width: min(420px, 100%); }
.search-form input { min-height: 40px; }
.search-form button { border: 0; background: var(--ink); color: white; border-radius: 8px; padding: 0 16px; cursor: pointer; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-heading { padding: 24px 24px 18px; margin: 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-weight: 650; text-align: left; background: var(--paper); }
th, td { padding: 13px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
td:first-child { white-space: normal; min-width: 150px; }
.status { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 750; }
.status.done { color: var(--green); background: var(--mint); }
.status.pending { color: #76673c; background: #f2ecd8; }
.row-actions { display: flex; align-items: center; gap: 10px; }
.table-action { border: 0; background: none; color: var(--danger); cursor: pointer; padding: 0; }
.delete-icon { width: 22px; height: 22px; border: 1px solid #ffd0d0; border-radius: 50%; background: #fff3f3; color: var(--danger); line-height: 18px; font-size: 18px; font-weight: 800; cursor: pointer; padding: 0; }
.empty-cell { text-align: center; color: var(--muted); padding: 35px; }
.activity-list { display: grid; }
.activity-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; padding-top: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-top: 6px; }
.activity-item strong, .activity-item span { display: block; }
.activity-item strong { font-size: 13px; margin-bottom: 3px; }
.activity-item div span { color: var(--muted); font-size: 11px; }

@media (max-width: 820px) {
  .public-shell, .success-shell { grid-template-columns: 1fr; padding-top: 42px; gap: 30px; }
  .brand-block { text-align: center; margin: 0 auto; }
  h1 { font-size: 52px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .public-shell { width: min(100% - 24px, 480px); padding-top: 30px; }
  .form-card, .download-card, .login-shell { padding: 24px; }
  .brand-block .lead { font-size: 15px; }
  .admin-header { padding: 0 16px; }
  .admin-header nav a { display: none; }
  .admin-main { width: calc(100% - 24px); padding-top: 28px; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 17px; }
  .stat-card strong { font-size: 27px; }
  .dashboard-heading { align-items: center; }
  .dashboard-heading .button { font-size: 12px; }
  .users-heading { display: grid; }
  .search-form { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
