/* 火影世界玩家站 —— 无外部依赖，全部本地资源 */
:root {
  --bg: #0b0e14;
  --bg2: #11161f;
  --card: #161c27;
  --card2: #1c2331;
  --line: #283244;
  --line-soft: #202a3a;
  --text: #e9edf5;
  --muted: #8b97ab;
  --accent: #ff6b35;
  --accent2: #ffb057;
  --gold: #ffcc66;
  --green: #4ade80;
  --blue: #60a5fa;
  --red: #f87171;
  --radius: 14px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
p { margin: 0; }

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(780px 420px at 12% -6%, rgba(255, 107, 53, .16), transparent 70%),
    radial-gradient(660px 380px at 92% 8%, rgba(96, 165, 250, .09), transparent 72%);
}
.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.muted { color: var(--muted); }
.accent { color: var(--accent2); }
.hl { color: var(--gold); }
.eyebrow {
  font-size: 11px; letter-spacing: .19em; font-weight: 700;
  color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 14, 20, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner { height: 68px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff7a3d, #e8412a);
  box-shadow: 0 5px 18px rgba(255, 107, 53, .32);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 16px; letter-spacing: .04em; }
.brand-text small { color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 8px 13px; border-radius: 9px; font-size: 14px; color: var(--muted);
  transition: .18s ease;
}
.nav-link:hover { color: var(--text); background: var(--card2); }
.nav-link.active { color: var(--accent2); background: rgba(255, 107, 53, .10); }
.topbar-right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.online-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #475569;
  box-shadow: 0 0 0 4px rgba(71, 85, 105, .16);
}
.online-dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(74, 222, 128, .14); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .18s ease;
  white-space: nowrap; background: none; color: var(--text);
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, #ff7a3d, #ec4b25);
  color: #fff; box-shadow: 0 6px 18px rgba(255, 107, 53, .24);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(255, 107, 53, .34); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost { border-color: var(--line); background: var(--card); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent2); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.25fr .85fr; gap: 46px;
  padding: 68px 0 54px; align-items: center;
}
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); letter-spacing: -.01em; font-weight: 800; }
.hero-desc { color: var(--muted); max-width: 560px; margin-top: 18px; font-size: 15px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.stats { display: flex; gap: 34px; margin-top: 42px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 26px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.hero-panel {
  background: linear-gradient(160deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 22px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 107, 53, .05);
}
.panel-title { font-weight: 700; font-size: 14px; }
.panel-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 20px;
  background: rgba(255, 107, 53, .15); color: var(--accent2);
}
.panel-body { padding: 22px; min-height: 150px; }
.panel-body h3 { font-size: 18px; margin-bottom: 8px; }
.panel-body .meta { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.panel-body .lines { color: #c9d2e0; font-size: 13.5px; white-space: pre-line; }
.panel-foot { padding: 13px 22px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.panel-foot a { color: var(--accent2); }

/* ---------- 通用区块 ---------- */
.section { padding: 54px 0 8px; }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; margin-bottom: 26px; flex-wrap: wrap;
}
.section-head h2 { font-size: 27px; }
.section-desc { color: var(--muted); margin-top: 9px; font-size: 14px; max-width: 720px; }
.count-badge {
  font-size: 13px; color: var(--muted); padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--card);
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}

/* ---------- 更新公告 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(var(--accent), var(--line));
}
.update-item { position: relative; margin-bottom: 16px; }
.update-item::before {
  content: ""; position: absolute; left: -25px; top: 24px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line);
}
.update-item.latest::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px rgba(255,107,53,.14); }
.update-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; transition: .18s ease; }
.update-card:hover { border-color: #3a465c; }
.update-item.latest .update-card { border-color: rgba(255, 107, 53, .45); background: linear-gradient(120deg, rgba(255,107,53,.06), var(--card) 46%); }
.update-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.update-head h3 { font-size: 17px; margin-right: 4px; }
.badge {
  font-size: 11px; padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge.ver { color: var(--accent2); border-color: rgba(255,176,87,.35); background: rgba(255,176,87,.08); font-family: ui-monospace, Consolas, monospace; }
.badge.tag-新增 { color: var(--green); border-color: rgba(74,222,128,.32); background: rgba(74,222,128,.08); }
.badge.tag-修复 { color: var(--red); border-color: rgba(248,113,113,.32); background: rgba(248,113,113,.08); }
.badge.tag-优化 { color: var(--blue); border-color: rgba(96,165,250,.32); background: rgba(96,165,250,.08); }
.badge.tag-公告 { color: var(--gold); border-color: rgba(255,204,102,.32); background: rgba(255,204,102,.08); }
.badge.latest { color: #fff; background: var(--accent); border-color: var(--accent); }
.badge.done { color: var(--green); border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.1); }
.badge.pending { color: var(--muted); }
.badge.working { color: var(--blue); border-color: rgba(96,165,250,.4); }
.badge.closed { color: var(--muted); opacity: .75; }
.update-time { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.update-content { margin-top: 12px; color: #c3ccda; font-size: 14px; white-space: pre-line; }

/* ---------- 物品查询 ---------- */
.searchbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px;
}
.searchbar:focus-within { border-color: var(--accent); }
.search-icon { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: 0 0 auto; }
#item-q {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--text); font-size: 15px;
}
#item-q::placeholder { color: #66738a; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px; }
.chip {
  padding: 6px 14px; border-radius: 20px; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  cursor: pointer; transition: .16s ease;
}
.chip:hover { color: var(--text); }
.chip.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip small { opacity: .7; margin-left: 5px; }
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.item-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 17px; transition: .18s ease; min-height: 132px;
}
.item-card:hover { border-color: #3d4a60; transform: translateY(-2px); }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.item-name { font-weight: 700; font-size: 15px; word-break: break-all; }
.item-id { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }
.item-cat { font-size: 11px; color: var(--blue); margin-top: 3px; }
.sources { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.source {
  background: var(--bg2); border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 7px 10px; font-size: 12.5px;
}
.source-via { color: var(--accent2); font-weight: 600; }
.source-note { color: var(--muted); display: block; margin-top: 2px; word-break: break-word; }
.item-note { margin-top: 10px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 9px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 42px 0; }
.loadmore-wrap { text-align: center; margin: 22px 0; }

/* ---------- 下载 ---------- */
.download-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dl-card {
  background: linear-gradient(150deg, var(--card2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.dl-top { display: flex; align-items: center; gap: 12px; }
.dl-icon {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255,107,53,.12); color: var(--accent2); font-size: 21px; flex: 0 0 auto;
}
.dl-title { font-weight: 700; font-size: 16px; }
.dl-ver { color: var(--muted); font-size: 12px; }
.dl-desc { color: #bdc7d7; font-size: 13.5px; flex: 1; }
.dl-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.dl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dl-sha { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: #63708a; }
.notice-box {
  margin-top: 18px; padding: 17px 20px; border-radius: 12px;
  background: rgba(96,165,250,.06); border: 1px solid rgba(96,165,250,.18);
  font-size: 13px; color: #b9c6da;
}
.notice-box b { color: var(--blue); display: block; margin-bottom: 5px; }

/* ---------- 反馈 ---------- */
.feedback-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 20px; align-items: start; }
.form-card h3 { font-size: 17px; margin-bottom: 16px; }
.form-card form { display: flex; flex-direction: column; gap: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* label 用 block 而不是 flex column：必填星号 <span> 才能与文字同一行。 */
label { display: block; font-size: 12.5px; color: var(--muted); }
.req { color: var(--accent); }
input, select, textarea {
  width: 100%; margin-top: 6px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 12px; color: var(--text); outline: none;
  font-size: 14px; transition: .16s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 108px; }
input::placeholder, textarea::placeholder { color: #5c687e; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-tip { color: var(--muted); font-size: 11.5px; }
.feedback-list { display: flex; flex-direction: column; gap: 12px; max-height: 620px; overflow-y: auto; padding-right: 4px; }
.fb-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.fb-card.done { border-color: rgba(74,222,128,.28); background: linear-gradient(120deg, rgba(74,222,128,.05), var(--card) 55%); }
.fb-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.fb-nick { font-weight: 700; font-size: 14px; }
.fb-time { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.fb-content { margin-top: 10px; font-size: 14px; color: #cbd4e2; white-space: pre-wrap; word-break: break-word; }
.fb-reply {
  margin-top: 12px; padding: 10px 12px; border-radius: 9px;
  background: rgba(74,222,128,.07); border-left: 3px solid var(--green);
  font-size: 13px; color: #cfe8d6; white-space: pre-wrap;
}
.fb-reply b { color: var(--green); }

/* ---------- 页脚 / toast ---------- */
.footer { margin-top: 72px; border-top: 1px solid var(--line-soft); background: rgba(17,22,31,.7); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 26px 0; flex-wrap: wrap; }
.footer-inner p { font-size: 12px; margin-top: 5px; }
.footer-links { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.footer-links a:hover { color: var(--accent2); }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 16px);
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 20px; border-radius: 10px; font-size: 13.5px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .22s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--red); }

/* ---------- 管理后台共用 ---------- */
.admin-body .admin-wrap { width: min(1100px, calc(100% - 40px)); margin: 0 auto; }
.login-box { max-width: 400px; margin: 14vh auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 0 10px; flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 22px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-row {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 16px; margin-bottom: 9px; flex-wrap: wrap;
}
.admin-row .grow { flex: 1; min-width: 220px; }
.admin-row .title { font-weight: 600; font-size: 14px; }
.admin-row .sub { color: var(--muted); font-size: 12px; margin-top: 3px; word-break: break-all; }
.admin-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.admin-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.admin-form .full { grid-column: 1 / -1; }
.admin-form label { gap: 5px; }
.mini-btn {
  padding: 6px 11px; font-size: 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
}
.mini-btn:hover { border-color: var(--accent); }
.mini-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); }
.admin-stat { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.admin-stat b { color: var(--text); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  html { scroll-padding-top: 112px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 44px; }
  .hero-panel { max-width: 620px; }
  .item-grid { grid-template-columns: repeat(2, 1fr); }
  .feedback-layout { grid-template-columns: 1fr; }
  .feedback-list { max-height: none; }
  /* 窄屏不隐藏导航：改成第二行横向滚动，保证四个板块始终有入口。 */
  .topbar-inner { height: auto; min-height: 60px; flex-wrap: wrap; padding: 9px 0; row-gap: 4px; }
  .nav {
    display: flex; order: 3; flex: 1 0 100%; flex-wrap: nowrap;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link { white-space: nowrap; }
  .topbar-right { margin-left: auto; }
}
@media (max-width: 640px) {
  .wrap { width: min(100% - 26px, 1160px); }
  .topbar-inner { height: auto; min-height: 58px; gap: 10px; }
  .brand-text small { display: none; }
  .topbar-right .online-dot { display: none; }
  .hero { padding: 34px 0 30px; }
  .hero h1 { font-size: 30px; }
  .stats { gap: 22px; margin-top: 28px; }
  .stat b { font-size: 21px; }
  .section { padding-top: 40px; }
  .section-head h2 { font-size: 23px; }
  .item-grid, .download-grid, .admin-form, .field-row { grid-template-columns: 1fr; }
  .timeline { padding-left: 20px; }
  .update-item::before { left: -19px; }
  .update-time { margin-left: 0; width: 100%; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
