:root {
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #192b2b;
  background: #f2f5f5;
  --muted: #536a6b;
  --border: #dbe5e4;
  --accent: #12665c;
  --accent-hover: #0b514a;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: progress; opacity: .55; }
:focus-visible { outline: 3px solid #198c78; outline-offset: 3px; }
::selection { background: #c6ebe1; color: #0c443b; }
.icon { display: inline-block; height: 20px; width: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 9px 15px;
  background: transparent; font-weight: 600; font-size: .9rem; white-space: nowrap;
  transition: background .16s, border-color .16s;
}
.button .icon { width: 17px; height: 17px; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); }
.secondary { border-color: var(--border); background: #fff; }
.secondary:hover, .bare:hover { background: #e9f1ee; }
.wide { width: 100%; }
.inline-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-weight: 600; }
.inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.inline-link .icon { width: 17px; height: 17px; }

.admin-shell { min-height: 100svh; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.rail {
  display: flex; flex-direction: column; gap: 42px; background: #142e31; color: #edf7f4;
  min-height: 100svh; padding: 30px 17px 22px; position: sticky; top: 0; align-self: start;
}
.wordmark { display: flex; align-items: center; gap: 12px; padding: 0 8px; font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.wordmark small { display: block; color: #a7c5bf; font-size: .76rem; font-weight: 500; }
.mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px; color: #0a4d41; background: #a9e1ce; flex: none; }
.mark .icon { width: 20px; height: 20px; }
.rail nav { display: grid; gap: 7px; }
.rail nav a { display: flex; align-items: center; gap: 10px; color: #c1d7d2; min-height: 46px; padding: 10px 12px; font-size: .92rem; border-radius: 8px; }
.rail nav a:hover, .rail nav a[aria-current] { background: #254f4d; color: #f3fcf8; }
.signout { margin-top: auto; }
.signout .button { color: #c1d7d2; }
.signout .button:hover { background: #254f4d; }
.workspace { width: 100%; max-width: 1580px; padding: 39px clamp(20px, 3vw, 52px) 44px; margin: 0 auto; }
.workspace-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
h1, h2, h3, p { margin-top: 0; }
.workspace h1 { margin-bottom: 7px; font-size: clamp(1.68rem, 3vw, 2.18rem); letter-spacing: -.035em; line-height: 1.25; }
.workspace-header p { margin: 0; color: var(--muted); font-size: .93rem; }
.workspace-date { color: var(--muted); font-size: .78rem; padding-bottom: 2px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 23px; }
.metric { padding: 18px 21px; border: 1px solid var(--border); background: #fff; border-radius: 13px; min-width: 0; }
.metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.metric-label .icon { color: var(--accent); width: 17px; height: 17px; }
.metric strong { display: block; margin-top: 11px; font-size: clamp(1.58rem, 3vw, 2rem); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.table-panel, .edit-panel, .preview-panel { border: 1px solid var(--border); background: #fff; border-radius: 13px; }
.table-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 19px; }
.table-top h2, .edit-panel h2, .preview-panel h2 { margin: 0; font-size: 1.065rem; }
.table-top h2 span { display: inline-block; background: #e8f1ee; color: #345950; margin-left: 5px; padding: 2px 7px; border-radius: 6px; font-size: .73rem; vertical-align: middle; }
.table-tools, .range-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-group { padding: 3px; gap: 2px; background: #edf3f1; border-radius: 8px; }
.range-group a { display: grid; place-items: center; min-height: 39px; padding: 4px 10px; font-size: .83rem; border-radius: 6px; color: #446160; white-space: nowrap; }
.range-group a:hover, .range-group a[aria-current] { background: #fff; color: #155b50; }
.range-group a[aria-current] { box-shadow: 0 1px 3px #19373222; font-weight: 650; }
.table-search { display: flex; align-items: center; gap: 8px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; color: var(--muted); }
.table-search .icon { width: 17px; height: 17px; }
.table-search input { min-width: 0; width: 8.8rem; border: 0; background: transparent; font-size: .85rem; padding: 9px 2px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .89rem; min-width: 770px; }
thead { background: #f1f6f5; color: #496361; }
thead th { padding-top: 13px; padding-bottom: 13px; font-size: .79rem; font-weight: 650; white-space: nowrap; }
th, td { padding: 12px clamp(9px, 1vw, 18px); }
th:first-child, td:first-child { padding-left: 19px; }
tbody tr { border-bottom: 1px solid #e5edeb; }
tbody tr:hover { background: #fafcfb; }
tbody th { font-weight: 400; }
.row-person { display: flex; align-items: center; gap: 11px; min-width: 136px; }
.person-token { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; background: var(--person-color); color: #284d49; font-weight: 650; font-size: .78rem; flex: none; overflow: hidden; }
.person-token img, .avatar img { width: 100%; height: 100%; object-fit: cover; }
.row-person strong { display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.row-person small { color: var(--muted); white-space: nowrap; }
.status { display: inline-flex; align-items: center; border-radius: 6px; padding: 4px 7px; font-size: .76rem; white-space: nowrap; }
.status.live { background: #e3f2e9; color: #235b40; }
.status.paused { background: #f0eeeb; color: #64554a; }
.number { text-align: left; font-weight: 650; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; white-space: nowrap; gap: 2px; }
.row-actions a, .row-actions button { display: inline-flex; min-height: 44px; align-items: center; gap: 4px; padding: 4px 6px; background: transparent; border: 0; border-radius: 6px; color: #136255; font-size: .84rem; }
.row-actions .icon { width: 15px; height: 15px; }
.row-actions a:hover, .row-actions button:hover { background: #e7f3ee; }
.table-note { color: var(--muted); padding: 15px 19px; margin: 0; font-size: .82rem; }

.back-link { margin-bottom: 7px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(235px, 1fr); gap: 22px; align-items: start; }
.edit-form { display: grid; gap: 16px; }
.edit-panel, .preview-panel { padding: 20px; }
.edit-panel h2, .preview-panel h2 { margin-bottom: 17px; }
.field, .upload-block { display: grid; gap: 7px; font-size: .92rem; font-weight: 600; margin-bottom: 17px; }
.field:last-child, .upload-block:last-child { margin-bottom: 0; }
.field small, .upload-block small { color: var(--muted); font-weight: 400; line-height: 1.5; }
.field input:not([type="color"]), .field textarea, .upload-block input[type="file"] {
  width: 100%; min-width: 0; padding: 10px 11px; background: #fcfdfc; border: 1px solid #cbdad6;
  border-radius: 7px; min-height: 44px; font-weight: 400;
}
.field textarea { resize: vertical; }
.upload-block input[type="file"]::file-selector-button { color: var(--accent); border: 0; border-radius: 4px; background: #e2eeea; padding: 4px 8px; margin-right: 8px; }
.check { display: inline-flex; gap: 7px; min-height: 44px; align-items: center; font-size: .87rem; font-weight: 500; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }
.color-field { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.color-field input { width: 48px; height: 44px; padding: 4px; border-radius: 7px; background: #fff; border: 1px solid var(--border); cursor: pointer; }
.color-field output { color: var(--muted); font-weight: 400; }
.preview-panel { position: sticky; top: 20px; }
.edit-actions { display: flex; justify-content: flex-end; gap: 9px; }
.mini-profile { width: min(100%, 420px); margin-inline: auto; border: 1px solid var(--border); border-radius: 13px; }
.mini-panel { min-height: var(--contact-area-min, 360px); padding: var(--contact-area-padding, 30px) clamp(12px, 5vw, 25px); }
.contact-area-settings { margin: 0 0 16px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.contact-area-settings legend { font-weight: 650; padding-inline: 4px; }
.contact-area-settings small { display: block; margin-top: 8px; color: var(--muted); }
.mini-identity { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.mini-profile h3 { font-size: .9rem; margin: 0; overflow-wrap: anywhere; }
.mini-identity p { font-size: .75rem; color: #354946; overflow-wrap: anywhere; margin: 3px 0 0; }
.mini-identity p:empty { display: none; }
.mini-profile .avatar { width: 36px; height: 36px; }
.button-settings-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.button-settings-head h2 { margin-bottom: 0; }
.button-settings p { margin: 10px 0 14px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.button-settings p.layout-warning { color: #884613; margin-bottom: 0; }
.button-platforms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.button-platforms button[aria-pressed="true"] { border-color: #358775; background: #e4f4ee; color: #154d40; }
.button-measures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button-measures .field { margin: 0; min-width: 0; }
.button-stage {
  outline: 1px dashed #a4c0b5;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), #dae7e1 calc(25% - 1px) 25%);
}
.canvas-button { position: absolute; top: var(--button-y); left: var(--button-x); width: var(--button-width); height: var(--button-height); }
.canvas-button.selected { z-index: 2; }
.canvas-grip { width: 100%; height: 100%; min-height: 0; touch-action: none; cursor: grab; user-select: none; text-align: left; }
.canvas-grip:active { cursor: grabbing; }
.canvas-button.selected .canvas-grip { outline: 2px solid #1d8571; outline-offset: -1px; }
.canvas-resize { display: none; position: absolute; bottom: -5px; right: -5px; width: 30px; height: 30px; border: 0; background: transparent; touch-action: none; cursor: nwse-resize; }
.canvas-button.selected .canvas-resize, .canvas-button:focus-within .canvas-resize { display: block; }
.canvas-resize::after { content: ""; position: absolute; bottom: 3px; right: 3px; width: 11px; height: 11px; border: 1px solid #1d8571; border-radius: 3px; background: #fff; }

.public-page { background: #eeeae4; min-height: 100svh; color: #202a26; }
.contact-page, .mini-profile {
  overflow: clip;
  background: #faf8f4;
}
.profile-cover {
  background: var(--profile-color, #e9eeeb);
  aspect-ratio: 1;
}
.profile-cover:has(.profile-cover-image:not([hidden])) { aspect-ratio: auto; }
.profile-cover-image { display: block; width: 100%; height: auto; }
.contact-page {
  width: 100%;
  max-width: 420px;
  min-height: 100svh;
  margin: 0 auto;
}
.contact-split { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.contact-split .profile-cover { width: 100%; height: clamp(255px, 50svh, 440px); aspect-ratio: auto; }
.contact-split .profile-cover:has(.profile-cover-image:not([hidden])) { height: auto; }
.profile-panel { min-height: var(--contact-area-min, 360px); padding: var(--contact-area-padding, 30px) 25px max(var(--contact-area-padding, 30px), env(safe-area-inset-bottom)); }
.wechat-page { padding: 20px 24px 24px; }
.profile-top { display: flex; align-items: center; min-height: 44px; font-weight: 650; font-size: .91rem; }
.identity { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.identity-text { min-width: 0; flex: 1; }
.avatar { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; color: #658876; background: #dce9df; overflow: hidden; }
.identity h1 { margin: 0; font-size: clamp(1.4rem, 6vw, 1.8rem); letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
.identity p { margin: 5px 0 0; color: #4d5b50; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-button { padding: 0; width: 44px; flex: none; border: 1px solid #e2e2d9; border-radius: 50%; color: #355548; }
.share-button:hover { background: #f0eee7; }
.contact-list { display: grid; gap: var(--contact-gap, 14px); }
.contact-list:not(.positioned-buttons) > .contact-row { min-height: 72px; }
.positioned-buttons { display: block; position: relative; height: var(--button-area-height); }
.positioned-buttons > .contact-row {
  position: absolute; top: var(--button-y); left: var(--button-x);
  width: var(--button-width); height: var(--button-height); min-height: 0;
}
.contact-row { display: flex; align-items: center; min-height: 63px; padding: 4px clamp(5px, 2vw, 14px); gap: clamp(5px, 2vw, 12px); border: 1px solid #e7e5dd; border-radius: 13px; background: #fff; transition: transform .18s, box-shadow .18s; container-type: inline-size; }
a.contact-row:hover { transform: translateY(-2px); box-shadow: 0 6px 18px #1a342a15; }
a.contact-row:active { transform: translateY(0); }
.contact-row > .icon { width: 17px; height: 17px; color: #587267; margin-left: auto; }
.contact-label { display: grid; gap: 3px; }
.contact-label strong { font-size: 1.08rem; }
.contact-label small { font-size: .81rem; color: #506960; }
.contact-label { flex: 1; min-width: 0; }
.contact-label strong, .contact-label small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-width: 170px) {
  .contact-row .brand { width: 25px; height: 25px; border-radius: 7px; }
  .contact-label { gap: 1px; }
  .contact-label strong { font-size: .83rem; }
  .contact-label small { font-size: .69rem; }
  .contact-row > .icon { display: none; }
}
.inactive .brand { filter: saturate(.53); }
.brand { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; flex: none; }
.brand svg { width: 100%; height: 100%; }
.brand-line { background: #08af4d; }
.brand-wechat { background: #11a56a; }
.brand-whatsapp { background: #15965f; }
.wechat-card { margin: 34px 0 0; background: #fff; border-radius: 20px; padding: 24px; }
.wechat-card .brand { margin-bottom: 15px; }
.wechat-card h1 { font-size: 1.55rem; margin-bottom: 8px; overflow-wrap: anywhere; }
.wechat-card p { color: var(--muted); line-height: 1.6; }
.copy-field { display: grid; gap: 7px; margin-bottom: 15px; font-size: .9rem; font-weight: 600; }
.copy-field input { min-width: 0; width: 100%; padding: 12px; border: 1px solid var(--border); background: #f0f5f2; border-radius: 8px; font-size: 1.03rem; }
.wechat-card .copy-note { margin: 14px 0 0; font-size: .88rem; }
.wechat-actions { display: grid; gap: 8px; }
.wechat-consult { margin: 0 0 18px; }

.login-page { display: grid; place-items: center; min-height: 100svh; padding: 18px; }
.login-card { width: min(100%, 420px); padding: 28px; border: 1px solid var(--border); background: #fff; border-radius: 16px; }
.login-mark { margin-bottom: 18px; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 8px; }
.login-card p { color: var(--muted); line-height: 1.6; }
.login-card form { margin-top: 22px; }
.notice { padding: 11px 13px; border-radius: 7px; font-size: .9rem; }
.notice.success { background: #dff3e6; color: #245a3d; }
.notice.error { background: #fae9e6; color: #7c2f25; }
.toast, .manual-copy { position: fixed; z-index: 3; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); }
.toast { padding: 11px 17px; border-radius: 9px; background: #193d35; color: #fff; box-shadow: 0 4px 24px #12393125; font-size: .91rem; pointer-events: none; }
.manual-copy { bottom: 78px; width: min(350px, calc(100% - 26px)); padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }

@media (min-width: 520px) {
  .public-page { padding: 22px 0; }
  .contact-page { min-height: min(836px, calc(100svh - 44px)); border-radius: 24px; box-shadow: 0 16px 42px #39342417; }
}
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 169px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .editor-grid { gap: 13px; }
}
@media (max-width: 720px) {
  .admin-shell { display: block; }
  .rail { position: static; min-height: auto; padding: 12px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .rail nav { display: flex; gap: 3px; order: 3; width: 100%; }
  .signout { margin: 0 0 0 auto; }
  .workspace { padding: 22px 14px; }
  .workspace-header { margin-bottom: 19px; }
  .metrics { gap: 6px; }
  .metric { padding: 12px 8px; }
  .metric-label { font-size: .75rem; gap: 4px; }
  .metric-label .icon { width: 14px; height: 14px; }
  .table-top { padding: 12px; }
  .editor-grid { display: flex; flex-direction: column-reverse; }
  .editor-grid > * { width: 100%; }
  .preview-panel { position: static; }
}
@media (max-width: 480px) {
  .wechat-card { margin-top: 19px; }
}
@media (max-width: 350px) {
  .profile-panel { padding-inline: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
