:root {
  --ink: #172126;
  --muted: #667279;
  --line: #dfe5e3;
  --soft: #f3f6f4;
  --paper: #fbfcfb;
  --green: #147d64;
  --green-dark: #0d624e;
  --wechat: #16a563;
  --taobao: #f05a24;
  --blue: #3167a6;
  --danger: #c8453b;
  --shadow: 0 18px 50px rgba(32, 55, 48, .12);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.site-header { height: 76px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(251,252,251,.94); }
.brand { display: inline-flex; gap: 12px; align-items: center; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; background: var(--ink); color: white; font-weight: 800; border-radius: 7px; }
.brand > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.brand strong { font-size: 15px; }
.brand small { color: #7d8986; font-size: 9px; letter-spacing: 1.2px; }
.admin-link { min-height: 38px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-weight: 700; background: white; transition: .2s; }
.admin-link:hover { border-color: #aebbb7; background: var(--soft); }
.admin-nav { display: flex; align-items: center; gap: 8px; }
.logout-button { min-height: 38px; padding: 0 13px; border: 1px solid #e4c4c0; border-radius: 6px; color: var(--danger); background: white; font-size: 12px; font-weight: 800; }
.logout-button:hover { background: #fff3f2; }
.auth-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 0, #e8f2ee 0, transparent 38%), var(--paper); }
.auth-screen[hidden] { display: none; }
.auth-card { width: min(410px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 9px; background: white; box-shadow: var(--shadow); text-align: center; }
.auth-mark { margin: 0 auto 20px; }.auth-card h1 { margin: 0; font-size: 27px; }.auth-card > p:not(.eyebrow) { margin: 10px 0 25px; color: var(--muted); font-size: 13px; }.auth-field { text-align: left; }.auth-card .primary-button { width: 100%; }.auth-card > a { display: inline-block; margin-top: 20px; color: var(--muted); font-size: 12px; }.auth-card > a:hover { color: var(--green); }

main:not(.admin-main) { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.intro { min-height: 300px; padding: 64px 0 52px; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; }
.intro h1 { max-width: 720px; margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(38px, 6vw, 64px); font-weight: 600; line-height: 1.12; letter-spacing: 0; }
.intro > div > p:last-child { margin: 20px 0 0; color: var(--muted); font-size: 16px; }
.status-card { min-width: 220px; padding: 18px 20px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #1fac6b; box-shadow: 0 0 0 5px #e5f6ee; }
.status-card span:last-child { display: flex; flex-direction: column; gap: 4px; }
.status-card strong { font-size: 14px; }
.status-card small { color: var(--muted); font-size: 12px; }

.channel-section { padding: 54px 0 42px; }
.section-heading { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; }
.section-heading h2 { margin: 0; font-size: 25px; }
.channel-count { color: var(--muted); font-size: 13px; }
.channel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.channel-card { min-height: 152px; padding: 24px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 7px; background: white; transition: transform .2s, border-color .2s, box-shadow .2s; }
.channel-card:hover { transform: translateY(-2px); border-color: #bac8c3; box-shadow: 0 10px 30px rgba(35,59,52,.07); }
.channel-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 7px; color: white; font-size: 16px; font-weight: 800; }
.channel-icon.wechat { background: var(--wechat); }
.channel-icon.taobao { background: var(--taobao); }
.channel-icon.other { background: var(--blue); }
.channel-info { min-width: 0; }
.channel-info h3 { margin: 0 0 8px; font-size: 17px; }
.channel-info p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.featured { margin-left: 7px; padding: 2px 6px; display: inline-block; vertical-align: 2px; border-radius: 3px; background: #e8f5f0; color: var(--green); font-size: 10px; font-weight: 800; }
.visit-button { min-width: 84px; height: 39px; padding: 0 13px; display: inline-flex; justify-content: center; align-items: center; gap: 6px; border: 1px solid var(--ink); border-radius: 5px; color: var(--ink); background: white; font-size: 13px; font-weight: 800; transition: .2s; }
.visit-button:hover { background: var(--ink); color: white; }
.visit-button.wechat-action { border-color: var(--wechat); color: var(--wechat); }
.visit-button.wechat-action:hover { background: var(--wechat); color: white; }
.empty-state { padding: 70px 20px; text-align: center; border: 1px dashed #cbd5d2; }
.empty-icon { margin: 0 auto 14px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--green); font-size: 24px; }
.empty-state h3 { margin: 0 0 8px; }.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.trust-bar { margin: 10px 0 70px; padding: 28px 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-bar > div { padding: 0 28px; display: flex; gap: 13px; align-items: center; border-right: 1px solid var(--line); }
.trust-bar > div:first-child { padding-left: 0; }.trust-bar > div:last-child { border-right: 0; }
.trust-bar > div > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e8f2ee; color: var(--green); font-size: 12px; font-weight: 800; }
.trust-bar p { margin: 0; display: flex; flex-direction: column; gap: 4px; }.trust-bar strong { font-size: 13px; }.trust-bar small { color: var(--muted); font-size: 11px; }
footer { min-height: 66px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: #7c8784; font-size: 11px; }

dialog { padding: 0; border: 0; border-radius: 8px; color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(12,23,21,.58); backdrop-filter: blur(2px); }
.wechat-dialog { width: min(430px, calc(100% - 32px)); padding: 38px; text-align: center; overflow: visible; }
.dialog-close { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #697570; font-size: 26px; line-height: 1; }
.dialog-close:hover { background: var(--soft); }
.wechat-badge { width: 48px; height: 48px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--wechat); font-size: 13px; font-weight: 800; }
.wechat-dialog h2 { margin: 0; font-size: 25px; }.dialog-desc { min-height: 21px; margin: 8px 0 20px; color: var(--muted); font-size: 13px; }
.qr-frame { width: 190px; height: 190px; margin: 0 auto 18px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.qr-frame img { width: 100%; height: 100%; display: block; object-fit: contain; }.qr-frame img[hidden] { display: none; }
.qr-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: var(--soft); color: #87928f; font-size: 13px; }
.wechat-id-row { min-height: 46px; margin-bottom: 12px; padding: 0 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: var(--soft); border-radius: 5px; font-size: 12px; }
.wechat-id-row span { color: var(--muted); }.wechat-id-row strong { overflow: hidden; text-overflow: ellipsis; }.wechat-id-row button { padding: 4px 7px; border: 0; color: var(--green); background: transparent; font-weight: 800; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 5px; font-weight: 800; font-size: 13px; }
.primary-button { border: 1px solid var(--green); background: var(--green); color: white; }.primary-button:hover { border-color: var(--green-dark); background: var(--green-dark); }
.wechat-open { width: 100%; }.dialog-hint { margin: 14px 0 0; color: #7d8986; font-size: 11px; line-height: 1.6; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 50; padding: 11px 16px; transform: translate(-50%, 20px); border-radius: 5px; background: #172126; color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; }.toast.show { transform: translate(-50%, 0); opacity: 1; }

.admin-main { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 50px 0 80px; }
.admin-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }.admin-titlebar h1 { margin: 0; font-size: 34px; }.admin-titlebar p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.metrics { margin: 32px 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 7px; background: white; }
.metrics div { min-height: 106px; padding: 22px 26px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }.metrics div:last-child { border: 0; }.metrics span { color: var(--muted); font-size: 12px; }.metrics strong { font-family: Georgia, serif; font-size: 29px; }
.manage-panel { border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; }.panel-toolbar { min-height: 86px; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }.panel-toolbar h2 { margin: 0 0 5px; font-size: 17px; }.panel-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.search-box { width: min(240px, 100%); min-height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--muted); }.search-box:focus-within { border-color: var(--green); }.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.table-wrap { overflow-x: auto; }table { width: 100%; border-collapse: collapse; white-space: nowrap; }th { padding: 12px 20px; color: #7b8783; background: var(--soft); text-align: left; font-size: 10px; font-weight: 800; }td { height: 72px; padding: 12px 20px; border-top: 1px solid #edf0ef; font-size: 12px; }tbody tr:first-child td { border-top: 0; }.channel-cell { display: flex; align-items: center; gap: 11px; }.channel-cell .channel-icon { width: 36px; height: 36px; border-radius: 5px; font-size: 11px; }.channel-cell strong { display: block; font-size: 13px; }.channel-cell small { display: block; max-width: 260px; margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }.type-tag { padding: 4px 7px; border-radius: 4px; background: var(--soft); color: #53615d; font-weight: 700; }.destination { display: block; max-width: 260px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }.state-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }.state-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a6afac; }.state-label.active { color: var(--green); }.state-label.active::before { background: #20a16c; }.actions-head, .row-actions { text-align: right; }.row-actions { min-width: 180px; }.icon-button { width: 31px; height: 31px; margin-left: 4px; border: 1px solid var(--line); border-radius: 4px; background: white; color: #52605c; font-size: 13px; }.icon-button:hover { background: var(--soft); }.icon-button.danger:hover { border-color: #e4b3ae; background: #fff2f1; color: var(--danger); }.admin-empty { padding: 55px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; }
.editor-dialog { width: min(620px, calc(100% - 32px)); }.editor-dialog form { padding: 30px; }.editor-heading { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; }.editor-heading h2 { margin: 0; font-size: 22px; }.dialog-close.static { position: static; flex: 0 0 auto; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 7px; }.field > span { font-size: 12px; font-weight: 800; }.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; outline: 0; color: var(--ink); background: white; font-size: 13px; }.field textarea { resize: vertical; }.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,125,100,.09); }.field small { color: var(--muted); font-size: 10px; }.form-grid.compact { margin-top: 4px; }.check-field { min-height: 62px; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 5px; }.check-field input { width: 17px; height: 17px; accent-color: var(--green); }.check-field span { display: flex; flex-direction: column; gap: 3px; }.check-field strong { font-size: 12px; }.check-field small { color: var(--muted); font-size: 10px; }.form-error { min-height: 18px; margin-top: 10px; color: var(--danger); font-size: 11px; }.form-actions { margin-top: 8px; display: flex; justify-content: flex-end; gap: 9px; }.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }.secondary-button:hover { background: var(--soft); }.danger-button { border: 1px solid var(--danger); background: var(--danger); color: white; }
.confirm-dialog { width: min(390px, calc(100% - 32px)); padding: 30px; text-align: center; }.danger-mark { width: 44px; height: 44px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: #fff0ef; color: var(--danger); font-weight: 900; }.confirm-dialog h2 { margin: 0 0 9px; font-size: 20px; }.confirm-dialog p { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }.confirm-dialog .form-actions { justify-content: center; }

@media (max-width: 760px) {
  .site-header { height: 66px; padding: 0 18px; }.admin-link span:last-child { display: none; }.admin-link { width: 38px; padding: 0; justify-content: center; }
  main:not(.admin-main) { width: min(100% - 28px, 600px); }.intro { min-height: 330px; padding: 50px 0 32px; display: block; }.intro h1 { font-size: 41px; }.intro > div > p:last-child { font-size: 14px; line-height: 1.7; }.status-card { width: 100%; min-width: 0; margin-top: 34px; }
  .channel-section { padding: 40px 0 30px; }.channel-list { grid-template-columns: 1fr; }.channel-card { min-height: 132px; padding: 18px 16px; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; }.channel-icon { width: 44px; height: 44px; }.visit-button { min-width: 66px; padding: 0 10px; }.visit-button .arrow { display: none; }
  .trust-bar { margin-bottom: 45px; grid-template-columns: 1fr; }.trust-bar > div { padding: 16px 4px; border-right: 0; border-bottom: 1px solid var(--line); }.trust-bar > div:first-child { padding-left: 4px; }.trust-bar > div:last-child { border-bottom: 0; }
  footer { padding: 18px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .wechat-dialog { padding: 34px 24px 26px; }.qr-frame { width: 170px; height: 170px; }
  .admin-main { width: calc(100% - 28px); padding: 36px 0 55px; }.admin-titlebar { align-items: flex-start; }.admin-titlebar h1 { font-size: 29px; }.admin-titlebar > .primary-button { padding: 0 12px; flex: 0 0 auto; }
  .auth-card { padding: 34px 24px; }.logout-button { width: 38px; padding: 0; font-size: 0; }.logout-button::after { content: "退"; font-size: 12px; }
  .metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }.metrics div { min-height: 90px; padding: 16px 12px; }.metrics strong { font-size: 24px; }
  .panel-toolbar { align-items: stretch; flex-direction: column; }.search-box { width: 100%; }.form-grid { grid-template-columns: 1fr; gap: 0; }.form-grid.compact { gap: 8px; }.editor-dialog form { padding: 24px 20px; }
}

@media (max-width: 430px) {
  .intro h1 { font-size: 36px; }.channel-card { grid-template-columns: 40px minmax(0, 1fr); }.channel-icon { width: 40px; height: 40px; }.channel-card .visit-button { grid-column: 2; justify-self: start; height: 36px; }.channel-info h3 { font-size: 16px; }.metrics span { font-size: 10px; }
}
