:root {
  --bg: #f7f8fa;
  --card: #fff;
  --ink: #1f2329;
  --sub: #8a94a6;
  --line: #eef1f5;
  --accent: #2b7fff;
  --soft: #eaf2ff;
  --ok: #12b76a;
  --danger: #e5484d;
  --shadow: 0 8px 24px rgba(17, 24, 39, .07);
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, .05);
  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.6 -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
main { max-width: 1400px; margin: 0 auto; padding: 14px 24px 50px; }
code { background: #f2f4f7; padding: 1px 5px; border-radius: 6px; font-size: 11.5px; }

/* ================= 顶部 ================= */
.hdr { background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.hdr-in { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 13px 24px; }
.logo b { font-size: 20px; letter-spacing: .5px; }
.logo i { font-style: normal; color: var(--accent); font-size: 12px; margin-left: 2px; }
.search { flex: 1; max-width: 460px; display: flex; }
.search input { flex: 1; height: 38px; padding: 0 16px; border: 1px solid #e3e8ef; border-right: 0; border-radius: 999px 0 0 999px; background: #f6f8fa; font-size: 13px; outline: none; transition: .2s; }
.search input:focus { background: #fff; border-color: #bcd3ff; }
.search button { height: 38px; padding: 0 22px; border: 0; border-radius: 0 999px 999px 0; background: var(--accent); color: #fff; cursor: pointer; font-size: 13px; }
.hlinks { display: flex; align-items: center; gap: 24px; font-size: 13.5px; color: #4b5563; margin-left: auto; }
.hlinks a:hover, .hlinks button:hover { color: var(--accent); }
.hlinks .who { color: var(--ink); }
.linkbtn { border: 0; background: none; color: inherit; font-size: inherit; cursor: pointer; padding: 0; }
.notice { max-width: 1400px; margin: 10px auto 0; background: #fff6f6; border: 1px solid #ffe3e3; color: #d4380d; border-radius: var(--r-sm); padding: 8px 14px; font-size: 12.5px; }
.notice a { color: #d4380d; text-decoration: underline; }

/* ================= 分类导航 ================= */
.tabs { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 65px; z-index: 40; }
.tabs-in { max-width: 1400px; margin: 0 auto; display: flex; gap: 4px; padding: 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs-in::-webkit-scrollbar { display: none; }
.tab { padding: 13px 14px; margin: 4px 0; font-size: 14.5px; color: #5b6472; white-space: nowrap; border-radius: var(--r-sm); transition: .15s; }
.tab:hover { color: var(--accent); background: #f4f7ff; }
.tab.on { color: var(--accent); font-weight: 600; background: var(--soft); }
.subs-in { max-width: 1400px; margin: 14px auto 0; display: flex; gap: 8px; flex-wrap: wrap; padding: 0 24px; }
.pill { padding: 5px 15px; border-radius: 999px; background: #f2f4f7; border: 1px solid transparent; color: #5b6472; font-size: 12.5px; transition: .15s; }
.pill:hover { color: var(--accent); background: #eaf2ff; }
.pill.on { background: var(--accent); color: #fff; }
.pill.fav { margin-left: auto; }

/* ================= 工具条 ================= */
.bar { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 12px; }
.bar-left b { font-size: 16px; margin-right: 10px; }
.cnt { color: var(--sub); font-size: 12.5px; }
.bar-right select { padding: 6px 12px; border: 1px solid #e3e8ef; border-radius: 999px; background: #fff; font-size: 12.5px; color: #4b5563; }

/* ================= 卡片 ================= */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: .2s; }
.card:hover { box-shadow: var(--shadow); border-color: #dfe6f3; transform: translateY(-2px); }
.thumb { position: relative; aspect-ratio: 4/3; background: #f0f3f8; cursor: pointer; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-mask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(17, 24, 39, .25); opacity: 0; transition: .18s; }
.card:hover .thumb-mask { opacity: 1; }
.pv-btn { padding: 6px 16px; border-radius: 999px; background: #fff; color: var(--accent); font-size: 12px; font-weight: 600; }
.badge { position: absolute; top: 10px; left: 10px; font-size: 11px; line-height: 18px; padding: 0 8px; border-radius: 999px; color: #fff; }
.badge.copy { background: #f79009; }
.badge.new { left: auto; right: 10px; background: #12b76a; }
.price-tag { position: absolute; left: 10px; bottom: 10px; background: rgba(229, 72, 77, .95); color: #fff; font-size: 11px; line-height: 18px; padding: 0 8px; border-radius: 999px; }
.cap { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; }
.cap .name { font-size: 13px; color: #344054; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap .right { display: flex; align-items: center; gap: 2px; flex: none; }
.star { border: 0; background: none; color: #c9d0da; font-size: 15px; cursor: pointer; padding: 0 3px; line-height: 1; }
.star.on { color: #f5a623; }
.copybtn { border: 0; background: none; color: #c9d0da; font-size: 14px; cursor: pointer; padding: 0 3px; line-height: 1; }
.copybtn:hover { color: var(--accent); }
.empty-box { background: #fff; border: 1px dashed #d7dde8; border-radius: var(--r-lg); padding: 56px 20px; text-align: center; color: var(--sub); }
.empty-box h2, .empty-box h3 { color: var(--ink); margin: 0 0 8px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 28px; color: var(--sub); font-size: 13px; }
.loading { padding: 60px; text-align: center; color: var(--sub); }

/* ================= 按钮 ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border: 0; border-radius: var(--r-md); background: var(--accent); color: #fff; font-size: 13.5px; cursor: pointer; transition: .15s; }
.btn:hover { background: #1f6ef0; }
.btn.sm { padding: 6px 14px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn.ghost { background: var(--soft); color: var(--accent); }
.btn.ghost:hover { background: #dceaff; }
.btn.danger { background: #fdecec; color: var(--danger); }
.btn.danger:hover { background: #fbdede; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ================= 弹窗 ================= */
.mask { position: fixed; inset: 0; background: rgba(17, 24, 39, .55); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal { position: relative; background: #fff; border-radius: var(--r-xl); width: min(820px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.small { width: min(420px, 100%); }
.modal .x { position: absolute; top: 12px; right: 14px; border: 0; background: rgba(255,255,255,.92); width: 30px; height: 30px; border-radius: 50%; font-size: 17px; cursor: pointer; color: #4b5563; z-index: 2; }
.modal-img { position: relative; background: #f1f5fb; }
.modal-img img { width: 100%; max-height: 420px; object-fit: contain; }
.modal-body { padding: 18px 22px 22px; }
.modal-body h3 { margin: 0 0 10px; font-size: 18px; }
.meta-line { display: flex; gap: 18px; flex-wrap: wrap; color: var(--sub); font-size: 12.5px; }
.modal-actions { display: flex; gap: 10px; margin: 16px 0 10px; flex-wrap: wrap; }
.contact-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.contact-list li { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; font-size: 13px; }
.contact-list span { color: var(--sub); }
.contact-list b { cursor: pointer; }
.contact-list b:hover { color: var(--accent); }
.mini-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--line); padding-top: 14px; }
.mini-form input, .mini-form textarea { padding: 9px 12px; border: 1px solid #e3e8ef; border-radius: var(--r-md); font-size: 13px; }
.mini-form input:focus, .mini-form textarea:focus { outline: none; border-color: var(--accent); }

/* ================= 登录 / 表单 ================= */
.auth-wrap { display: flex; justify-content: center; padding: 56px 20px; }
.auth { width: min(400px, 94vw); background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 30px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm); }
.auth.wide { width: min(560px, 94vw); }
.auth h2 { margin: 0; font-size: 19px; }
.auth label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--sub); }
.auth input, .auth select, .auth textarea { padding: 10px 14px; border: 1px solid #e3e8ef; border-radius: var(--r-md); font-size: 14px; color: var(--ink); background: #fff; }
.auth input:focus, .auth select:focus, .auth textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,127,255,.1); }
.auth .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tip { font-size: 12px; color: var(--sub); margin: 0; }
.tip a { color: var(--accent); }
.tip.err { color: var(--danger); }
.brand-lg { font-size: 18px; font-weight: 800; }

/* ================= 页脚 / 浮标 ================= */
.foot { text-align: center; color: #98a2b3; font-size: 12px; padding: 30px 20px 54px; }
.foot p { margin: 4px 0; }
.foot-name { color: #4b5563; font-weight: 600; }
.foot-sub { opacity: .75; }
.float { position: fixed; right: 24px; bottom: 56px; border: 0; background: #12b76a; color: #fff; padding: 10px 14px; border-radius: var(--r-lg); font-size: 12px; cursor: pointer; box-shadow: 0 10px 26px rgba(18,183,106,.32); z-index: 45; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.float em { font-style: normal; font-size: 10px; opacity: .9; }

/* ================= 授权绑定页 ================= */
.bind-notice { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #fff6f6; border: 1px solid #ffe3e3; color: #d4380d; border-radius: var(--r-md); padding: 9px 14px; font-size: 12.5px; margin: 6px 0 16px; }
.bind-actions { display: flex; gap: 8px; flex: none; }
.bind-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.bind-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 520px; }
.bind-card header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid #f2f4f7; }
.bind-card header b { font-size: 15px; }
.lock { margin-left: auto; opacity: .3; font-size: 13px; }
.bind-ico { width: 32px; height: 32px; border-radius: 11px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.bind-ico.grey { background: #eef1f7; color: #98a2b3; }
.bind-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.bind-body label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--sub); }
.bind-body label .lb { display: block; }
.bind-body em { color: var(--danger); font-style: normal; margin-right: 2px; }
.bind-body input { padding: 10px 14px; border: 1px solid #e3e8ef; border-radius: var(--r-md); font-size: 14px; }
.bind-body input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,127,255,.1); }
.bind-foot { padding: 0 18px 18px; }
.bind-submit { width: 100%; background: #f0fdf4; color: #12b76a; border: 1px solid #bbf7d0; border-radius: 999px; padding: 9px; font-size: 13px; cursor: pointer; transition: .15s; }
.bind-submit:hover { background: #dcfce7; }
.others-tools { display: flex; gap: 8px; padding: 14px 18px 0; }
.others-table { margin: 12px 18px 0; width: auto; box-shadow: none; }
.others-table th, .others-table td { padding: 8px; font-size: 12.5px; }
.others-table td input:not([type=checkbox]) { width: 100%; padding: 6px 10px; border: 1px solid #e3e8ef; border-radius: var(--r-sm); font-size: 12.5px; }
.empty-cell { text-align: center; color: #98a2b3; padding: 22px 0 !important; }
.others-tip { padding: 12px 18px 0; }

/* ================= 后台 ================= */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #0f172a; color: #c3cede; padding: 18px 12px; display: flex; flex-direction: column; }
.side .brand { font-weight: 800; color: #fff; font-size: 16px; padding: 8px 10px 16px; }
.side a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: var(--r-md); color: #c3cede; font-size: 13.5px; cursor: pointer; }
.side a.on, .side a:hover { background: #1c2a44; color: #fff; }
.side .sep { height: 1px; background: #26324c; margin: 12px 8px; }
.side .who-side { padding: 0 12px; font-size: 12px; color: #7c8aa3; }
.dot { background: #e5484d; color: #fff; font-style: normal; font-size: 10px; padding: 0 6px; border-radius: 999px; line-height: 16px; }
.main { padding: 24px 28px 60px; background: var(--bg); overflow-x: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 19px; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tools input, .tools select { padding: 7px 12px; border: 1px solid #e3e8ef; border-radius: var(--r-sm); font-size: 13px; background: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat span { color: var(--sub); font-size: 12.5px; }
.stat em { font-style: normal; color: #f79009; font-size: 11px; margin-left: 4px; }
.two-col { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 22px; }
.two-col h3 { font-size: 15px; margin: 0 0 10px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f8fafc; color: var(--sub); font-weight: 600; font-size: 12.5px; }
tr:last-child td { border-bottom: 0; }
td img { width: 72px; height: 45px; object-fit: cover; border-radius: var(--r-sm); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.note-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sub); }
.acc-cell { max-width: 360px; line-height: 2; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #f2f4f7; color: #4b5563; }
.tag.ok { background: #e7f8ef; color: #0f9d58; }
.tag.warn { background: #fef3e2; color: #b26b00; }
.tag.orange { background: #fff1e0; color: #c05a00; }
.tag.green { background: #e7f8ef; color: #0f9d58; }
.tag.red { background: #fdecec; color: #c03232; }
.chip { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #f2f5fb; color: #4b5563; margin: 2px 4px 2px 0; }
.sub-tags { display: flex; flex-wrap: wrap; gap: 2px; max-width: 520px; }
.order-btns { display: flex; flex-direction: column; gap: 3px; }
.mini { width: 24px; height: 21px; border: 1px solid #e3e8ef; background: #fff; border-radius: 7px; font-size: 11px; cursor: pointer; line-height: 1; }
.mini:disabled { opacity: .35; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.plat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.modal-mask { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px; }
.modal-mask .modal { background: #fff; border-radius: var(--r-xl); width: min(560px, 94vw); padding: 24px; max-height: 92vh; overflow: auto; }
.modal-mask h3 { margin: 0 0 16px; }
.modal-mask .form { display: flex; flex-direction: column; gap: 12px; }
.modal-mask label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--sub); }
.modal-mask input, .modal-mask select, .modal-mask textarea { padding: 9px 12px; border: 1px solid #e3e8ef; border-radius: var(--r-md); font-size: 14px; color: var(--ink); background: #fff; }
.modal-mask textarea { resize: vertical; font-family: inherit; }
.modal-mask input:focus, .modal-mask select:focus, .modal-mask textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,127,255,.1); }
.modal-mask .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-mask .checks { display: flex; gap: 18px; }
.modal-mask .inline { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.card-form { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
.card-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--sub); }
.card-form input { padding: 9px 12px; border: 1px solid #e3e8ef; border-radius: var(--r-md); font-size: 14px; }
.card-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,127,255,.1); }
.card-form h4 { margin: 8px 0 0; font-size: 14px; }
.card-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.up-item { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.up-img { aspect-ratio: 16/10; background: #f1f5fb; }
.up-img img { width: 100%; height: 100%; object-fit: contain; }
.up-meta { display: flex; justify-content: space-between; padding: 8px 10px 0; font-size: 12px; color: var(--sub); }
.up-item .row-actions { padding: 8px 10px 10px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 30% 20%, #eef4ff, #f7f8fa 60%); }
.login-card { width: min(380px, 92vw); }
.empty { color: var(--sub); text-align: center; padding: 26px 0; }

/* ================= toast ================= */
#toast { position: fixed; left: 50%; bottom: 42px; transform: translate(-50%, 20px); background: #101828; color: #fff; padding: 10px 18px; border-radius: var(--r-md); font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) { .bind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .admin { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; align-items: center; gap: 4px; }
  .side .brand, .side .sep, .side .who-side { display: none; }
  .hlinks { display: none; }
}
@media (max-width: 680px) { .bind-grid { grid-template-columns: 1fr; } .bind-notice { flex-direction: column; align-items: flex-start; } }
