/* 掘金联盟 · DeBox 官方下载（视觉参考 DeBox 招人海报） */
:root {
  --ink: #04301a;
  --ink-2: #2b5c40;
  --muted: #6b8f7a;
  --line: #d5ecdd;
  --mint: #e9f8ee;
  --mint-2: #dff3e6;
  --green: #12a35c;
  --green-2: #0b7a44;
  --green-deep: #05341d;
  --lime: #b6f26a;
  --card: #ffffff;
  --danger: #c8432f;
  --radius: 26px;
  --shadow: 0 18px 40px -24px rgba(4, 48, 26, .35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--ink);
  background:
    radial-gradient(900px 420px at 85% -5%, rgba(182, 242, 106, .38), transparent 60%),
    radial-gradient(700px 380px at -10% 20%, rgba(18, 163, 92, .16), transparent 55%),
    linear-gradient(180deg, #eaf9f0 0%, #e2f5ea 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: min(560px, 100%); margin: 0 auto; padding: 0 20px; }

/* 顶部 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 0 0; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--green-deep); color: var(--lime); font-weight: 900; font-size: 18px;
  box-shadow: 0 10px 22px -12px rgba(4, 48, 26, .8);
}
.brand-text h1 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -.3px; }
.brand-text p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.top-link {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-size: 12.5px; font-weight: 700; color: var(--green-2);
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px;
}

/* 主视觉 */
.hero { padding: 30px 0 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-size: 11.5px; font-weight: 800; color: var(--green-2);
  letter-spacing: .6px; text-transform: uppercase;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.hero h2 {
  margin: 14px 0 0; font-size: clamp(34px, 9vw, 54px); line-height: 1.02; letter-spacing: -1.5px;
  font-weight: 900; color: var(--ink);
}
.hero h2 .accent { color: var(--green); }
.hero p { margin: 12px 0 0; font-size: 14px; line-height: 1.75; color: var(--ink-2); max-width: 30em; }

/* 分类大卡 */
.app-card {
  background: var(--card); border: 1px solid rgba(213, 236, 221, .9); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-top: 6px;
}
.app-head { display: flex; align-items: center; gap: 14px; }
.app-icon {
  width: 62px; height: 62px; border-radius: 18px; flex: none; display: grid; place-items: center;
  background: linear-gradient(145deg, #d9fbe6, #bff3d3); color: var(--green-deep); font-size: 28px;
  border: 1px solid #c6ecd4;
}
.app-title { flex: 1; min-width: 0; }
.app-title h3 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -.4px; }
.app-title p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.badge {
  flex: none; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 6px 11px; font-size: 11.5px; font-weight: 800; background: var(--mint); color: var(--green-2);
  border: 1px solid #c9eed7; white-space: nowrap;
}
.badge.unlocked { background: var(--green-deep); color: var(--lime); border-color: var(--green-deep); }

.app-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px; padding: 14px 20px; font-size: 15px; font-weight: 800;
  text-decoration: none; cursor: pointer; transition: transform .15s, filter .15s;
  font-family: inherit;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--green-deep); color: var(--lime); flex: 1; box-shadow: 0 14px 26px -14px rgba(5, 52, 29, .9); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--mint); color: var(--green-2); border: 1px solid #c9eed7; }
.btn svg { width: 17px; height: 17px; }

/* 文件列表 */
.files { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.file-row {
  display: flex; align-items: center; gap: 12px; background: #f7fcf9; border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px;
}
.file-badge {
  width: 44px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--mint-2); color: var(--green-deep); font-weight: 900; font-size: 11px; letter-spacing: .3px;
}
.file-info { flex: 1; min-width: 0; }
.file-info b { display: block; font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl {
  flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--green); color: #fff; border-radius: 12px; padding: 9px 14px; font-size: 13px; font-weight: 800;
}
.dl:hover { background: var(--green-2); }
.dl svg { width: 14px; height: 14px; }

.locked-hint {
  margin-top: 16px; background: #f4fbf6; border: 1px dashed #bfe6cf; border-radius: 16px;
  padding: 18px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7;
}

/* 底部条 */
.footer-bar {
  margin: 26px 0 34px; background: var(--green-deep); color: #d8f5e2; border-radius: 20px;
  padding: 16px 18px; display: flex; align-items: center; gap: 14px; justify-content: space-between;
}
.footer-bar b { display: block; font-size: 14.5px; color: #fff; }
.footer-bar span { display: block; font-size: 11.5px; color: #9ed3b2; margin-top: 3px; }
.footer-bar a { color: var(--lime); font-weight: 900; text-decoration: none; font-size: 13px; white-space: nowrap; }

.copyright { text-align: center; color: #86a894; font-size: 11px; padding-bottom: 26px; }

/* 口令弹层 */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: flex; flex-direction: column; justify-content: flex-end; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 30, 18, .45); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; margin: 0 auto; width: min(520px, 100%); background: #fff;
  border-radius: 26px 26px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -20px 60px rgba(4, 30, 18, .3);
}
.modal-head { display: flex; align-items: flex-start; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 900; }
.modal-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.modal-head .x {
  margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: 16px; display: grid; place-items: center;
}
.field { display: block; margin-top: 16px; }
.field span { display: block; font-size: 12.5px; font-weight: 800; color: var(--ink-2); margin-bottom: 7px; }
.field input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px;
  font-size: 17px; font-family: inherit; outline: 0; letter-spacing: 2px; background: #f9fdfa;
}
.field input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(18, 163, 92, .12); }
.err { min-height: 18px; margin-top: 8px; font-size: 12.5px; color: var(--danger); }
.modal-foot { display: flex; gap: 10px; margin-top: 6px; }

/* toast */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 26px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  background: var(--green-deep); color: #eafff2; font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 14px 30px -12px rgba(4, 30, 18, .6);
  max-width: 90vw; text-align: center;
}
.toast.err { background: #7f2318; }

@media (min-width: 641px) {
  .modal.open { align-items: center; justify-content: center; }
  .modal-panel { border-radius: 24px; padding: 24px; }
}

/* ---------------- 管理后台（同风格） ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 24px;
  padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}
.login-card .brand-mark { width: 52px; height: 52px; border-radius: 16px; font-size: 20px; }
.login-card h1 { margin: 0; font-size: 21px; font-weight: 900; }
.login-card > p { margin: -2px 0 4px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.login-card > p b { color: var(--ink); }
.login-error { min-height: 18px; font-size: 12.5px; color: var(--danger); text-align: center; }
.login-back { text-align: center; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.btn.block { width: 100%; }
/* 兼容后台沿用的旧类名 */
.btn.primary { background: var(--green-deep); color: var(--lime); }
.btn.ghost { background: var(--mint); color: var(--green-2); border: 1px solid #c9eed7; }

.admin-top { position: sticky; top: 0; z-index: 40; background: rgba(233, 248, 238, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.admin-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.admin-main { padding: 18px 20px 60px; display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 900; }
.panel-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  color: var(--green-2); border-radius: 999px; padding: 8px 14px; font-size: 12.5px; font-weight: 700;
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .field { margin-top: 0; }
.form-grid .field input, .form-grid .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; outline: 0; letter-spacing: 0; background: #f9fdfa;
}
.form-grid .field select { appearance: auto; }
.upload-line { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.upload-line input[type=file] { flex: 1; min-width: 200px; font-size: 13px; }
.upload-status { font-size: 12.5px; color: var(--muted); }
.progress { margin-top: 12px; }
.progress-bar { height: 8px; background: var(--mint-2); border-radius: 99px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--lime)); transition: width .2s; }
.item-list { display: flex; flex-direction: column; gap: 9px; }
.item-row { display: flex; align-items: center; gap: 12px; background: #f7fcf9; border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; }
.item-row .q { width: 42px; height: 44px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--mint-2); color: var(--green-deep); font-weight: 900; font-size: 10.5px; }
.item-row .t { flex: 1; min-width: 0; }
.item-row .t b { display: block; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row .t span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.item-row .acts { display: flex; gap: 6px; flex: none; }
.btn-sm {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 11px;
  font-size: 12.5px; font-weight: 700; color: var(--green-2); text-decoration: none; cursor: pointer; font-family: inherit;
}
.empty-box { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; background: #f9fdfa; border: 1px dashed var(--line); border-radius: 14px; }
.pwd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pwd-grid .field span { display: flex; align-items: center; gap: 6px; }
.hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.confirm-text { margin: 0; font-size: 14px; line-height: 1.75; }
.unlock-panel { width: min(420px, 100%); }

@media (max-width: 720px) {
  .form-grid, .pwd-grid { grid-template-columns: 1fr; }
  .admin-main { padding: 14px; }
  .panel { padding: 15px; }
  .app-title h3 { font-size: 20px; }
}
