:root {
  --navy: #173a63;
  --blue: #3f7fbd;
  --blue-deep: #2867a6;
  --cyan: #55aeba;
  --teal: #42a49a;
  --ink: #20354c;
  --muted: #6f8298;
  --line: #d9e6f1;
  --canvas: #f4f9fd;
  --panel: rgba(255, 255, 255, 0.88);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(181, 221, 247, .55), transparent 28rem),
    radial-gradient(circle at 92% 10%, rgba(191, 236, 230, .45), transparent 30rem),
    linear-gradient(180deg, #f7fbfe 0%, #eef6fb 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 15px;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(63, 127, 189, .2);
  outline-offset: 2px;
}

header {
  height: 78px;
  padding: 0 max(28px, calc((100vw - 1460px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--navy);
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid rgba(206, 224, 238, .9);
  box-shadow: 0 7px 26px rgba(52, 92, 128, .07);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand > img { width: 58px; height: 48px; object-fit: contain; filter: drop-shadow(0 7px 12px rgba(55, 137, 166, .16)); }
.brand span { display: grid; }
.brand strong { font-size: 19px; letter-spacing: .09em; }
.brand small { margin-top: 3px; color: #8296a9; font-size: 9px; letter-spacing: .22em; }
.live { display: flex; align-items: center; gap: 9px; color: #71859a; font-size: 13px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #52b9a6; box-shadow: 0 0 0 6px rgba(82, 185, 166, .13); }

.wrap { width: min(1460px, calc(100% - 56px)); margin: auto; padding: 46px 0 52px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.hero p { margin: 0 0 11px; color: var(--blue-deep); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.hero h1 { margin: 0; color: #183b61; font-size: clamp(34px, 3.2vw, 48px); line-height: 1.15; letter-spacing: -.045em; }
.hero > div > span { display: block; margin-top: 13px; color: var(--muted); font-size: 15px; }
.updated { display: grid; grid-template-columns: auto auto; gap: 5px 14px; text-align: right; }
.updated small, .updated strong { grid-column: 1; }
.updated small { color: var(--muted); font-size: 12px; }
.updated strong { color: #38526d; font-size: 16px; }
.updated button {
  grid-column: 2; grid-row: 1 / 3;
  padding: 0 16px;
  color: var(--blue-deep);
  background: rgba(255,255,255,.85);
  border: 1px solid #cbddea;
  border-radius: 11px;
  box-shadow: 0 5px 14px rgba(52, 92, 128, .06);
}

nav { display: flex; align-items: center; gap: 8px; margin: 33px 0 24px; border-bottom: 1px solid #cedfea; }
nav button { position: relative; padding: 14px 20px 16px; color: #718397; background: none; border: 0; font-size: 15px; font-weight: 700; }
nav button:hover { color: var(--blue-deep); }
nav button.active { color: var(--navy); }
nav button.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: linear-gradient(90deg, var(--blue), var(--teal)); border-radius: 3px 3px 0 0; }
nav .admin-login {
  margin-left: auto;
  padding: 9px 14px;
  color: var(--blue-deep);
  background: rgba(255,255,255,.72);
  border: 1px solid #c8ddea;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: 0 5px 15px rgba(52, 92, 128, .05);
}
nav .admin-login::after { display: none; }
nav .admin-login.edit-active { color: #20796e; background: #e7f6f2; border-color: #b9e1d8; }

.panel {
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid rgba(208, 225, 238, .92);
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(50, 91, 126, .07);
  backdrop-filter: blur(14px);
}
.panelhead { display: flex; align-items: baseline; justify-content: space-between; padding: 26px 28px 21px; }
.panelhead h2, .toolbar h2 { margin: 0; color: #244762; font-size: 20px; letter-spacing: -.02em; }
.panelhead span, .toolbar span { color: #8496a8; font-size: 12px; }

.kpis { display: grid; grid-template-columns: 1.15fr repeat(4, 1fr); gap: 16px; }
.kpis article {
  min-height: 158px;
  padding: 25px;
  overflow: hidden;
  position: relative;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(208, 225, 238, .96);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(50, 91, 126, .065);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.kpis article::after { content: ""; position: absolute; width: 95px; height: 95px; right: -38px; top: -42px; border-radius: 50%; background: #83bde7; opacity: .13; }
.kpis article.dark { color: #20496c; background: linear-gradient(145deg, #dceefb, #d9f3ef); border-color: #c1deeb; box-shadow: 0 12px 30px rgba(61, 135, 174, .12); }
.kpis article.dark::after { width: 130px; height: 130px; right: -35px; top: -55px; opacity: .2; background: linear-gradient(145deg, #63a3d7, #60b7aa); }
.kpis article.warn { border-left: 4px solid #e5ad61; background: linear-gradient(145deg, #fffdf7, #fff8ea); }
.kpis span { display: block; color: var(--muted); font-size: 14px; }
.kpis .dark span { color: #3d698c; }
.kpis b { display: block; margin: 13px 0 9px; color: #233f5b; font-size: 43px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpis small { color: #8495a7; font-size: 12px; }
.kpis .dark small { color: #567b96; }

.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; padding: 0 28px 28px; }
.funnel article { padding: 20px 19px 18px; background: linear-gradient(160deg, rgba(249,252,254,.9), rgba(239,247,252,.72)); border: 1px solid #dce8f1; border-radius: 14px; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.funnel article:nth-child(2) { background: linear-gradient(160deg, #f6fbfe, #edf8fa); }
.funnel article:nth-child(3) { background: linear-gradient(160deg, #fffcf5, #faf4e8); }
.funnel article:nth-child(4) { background: linear-gradient(160deg, #fbf9fe, #f2eef9); }
.funnel article:nth-child(5) { background: linear-gradient(160deg, #f5fbf9, #eaf7f3); }
.funnel small { color: #a0adba; font-size: 11px; font-weight: 800; }
.funnel span { display: block; margin-top: 10px; color: #617489; font-size: 14px; }
.funnel b { display: block; margin-top: 6px; color: #27445e; font-size: 32px; }
.funnel em { margin-left: 4px; color: #8a99a8; font-size: 11px; font-style: normal; }
.funnel article > div { height: 5px; margin-top: 15px; overflow: hidden; background: #dce6ee; border-radius: 5px; }
.funnel i { display: block; height: 100%; background: linear-gradient(90deg, #5d96c9, #60b6ae); border-radius: inherit; transition: filter .22s ease, box-shadow .22s ease; }

.grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 16px; }
.bars { display: grid; gap: 8px; padding: 0 28px 30px; }
.bars > div { position: relative; display: grid; grid-template-columns: 108px 1fr 28px; align-items: center; gap: 13px; padding: 4px 7px; border-radius: 10px; transition: background .2s ease, transform .2s ease; }
.bars > div > span { color: #5e7185; font-size: 13px; text-align: right; }
.bars .bar-track { position: relative; height: 29px; }
.bars .bar { position: absolute; left: 0; height: 7px; border-radius: 0 5px 5px 0; cursor: help; transform-origin: left center; transition: filter .18s ease, transform .18s ease, box-shadow .18s ease; }
.bars .p { top: 0; background: #d9e6ef; }
.bars .o { top: 11px; background: #6d9fd0; }
.bars .a { top: 22px; background: #63b1a8; }
.bars > div > b { color: #6c7e90; font-size: 12px; }
.bars .bar::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 12;
  left: 100%;
  top: 50%;
  min-width: max-content;
  padding: 7px 10px;
  color: #f8fbfe;
  background: rgba(38, 66, 91, .96);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(28, 60, 86, .2);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -50%) scale(.96);
  transition: opacity .16s ease, transform .16s ease;
}
.bars .bar.edge::after { left: auto; right: 0; transform: translate(-6px, -50%) scale(.96); }
.bars .bar:focus-visible { outline: 2px solid #326f9f; outline-offset: 3px; }
.bars .bar:focus-visible::after { opacity: 1; transform: translate(8px, -50%) scale(1); }
.bars .bar.edge:focus-visible::after { transform: translate(-6px, -50%) scale(1); }
.bars .bar-row::after {
  content: attr(data-summary);
  position: absolute;
  z-index: 11;
  right: 36px;
  bottom: calc(100% - 2px);
  padding: 7px 10px;
  color: #f8fbfe;
  background: rgba(38, 66, 91, .96);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(28, 60, 86, .18);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}
.bars .bar-row:focus::after { opacity: 1; transform: translateY(0); }
.split { display: flex; align-items: center; justify-content: center; gap: 36px; padding: 14px 28px 38px; }
.donut { width: 145px; height: 145px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: radial-gradient(circle, #fff 0 53%, transparent 54%), conic-gradient(#75a6d2 0 42%, #69b9ae 42% 100%); box-shadow: 0 8px 25px rgba(67, 130, 166, .12); transition: transform .22s ease, box-shadow .22s ease; }
.donut b { color: #294964; font-size: 34px; }
.donut small { color: #8193a4; font-size: 11px; }
.split > div:last-child p { display: grid; grid-template-columns: 10px 1fr; gap: 3px 10px; margin: 18px 0; padding: 7px 9px; border-radius: 9px; transition: background .2s ease, transform .2s ease; }
.split p i { grid-row: 1 / 3; width: 9px; height: 38px; border-radius: 5px; }
.split .social { background: #75a6d2; }
.split .partner { background: #69b9ae; }
.split p b { font-size: 14px; }
.split p span { color: #7e90a2; font-size: 11px; }

.tablepanel { overflow: hidden; }
.toolbar { display: flex; justify-content: space-between; gap: 20px; padding: 26px 28px 21px; }
.toolbar > div:first-child { display: grid; gap: 5px; }
.toolbar > div:last-child { display: flex; gap: 10px; }
.toolbar input, .toolbar select { height: 42px; padding: 0 13px; color: #465c72; background: rgba(255,255,255,.9); border: 1px solid #d1e0eb; border-radius: 10px; font-size: 13px; }
.toolbar input { width: 230px; }
.privacy { margin: 0 28px 18px; padding: 11px 13px; color: #597087; background: #edf6fc; border: 1px solid #ddebf4; border-radius: 9px; font-size: 12px; }
.scroll { overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; min-width: 1580px; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; padding: 14px 12px; color: #5a6e82; background: #eaf3f9; border-bottom: 1px solid #d6e4ed; white-space: nowrap; text-align: left; }
td { padding: 15px 12px; color: #3f556a; background: rgba(255,255,255,.88); border-bottom: 1px solid #e8eef3; }
tbody tr:hover td { background: #f5faff; box-shadow: inset 0 1px rgba(111, 159, 195, .08), inset 0 -1px rgba(111, 159, 195, .08); }
td small { display: block; margin-top: 4px; color: #8a99a8; font-size: 11px; }
td > label { display: inline-block; padding: 5px 8px; color: #2f6b9c; background: #e5f1fa; border-radius: 6px; font-size: 11px; font-weight: 700; }
td > label.partner { color: #287b72; background: #e4f5f1; }
td.gap { color: #bd5c62; font-weight: 800; }
mark { display: inline-flex; align-items: center; padding: 5px 9px; color: #788797; background: #eef2f5; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
mark::before { content: ""; width: 6px; height: 6px; margin-right: 6px; background: currentColor; border-radius: 50%; }
mark.blue { color: #3877ae; background: #e6f1fa; }
mark.purple { color: #7b65a1; background: #f0ecf7; }
mark.green { color: #2b8075; background: #e4f3ef; }
.edit { padding: 8px 13px; color: #fff; background: linear-gradient(135deg, #5b91c3, #58aaa2); border: 0; border-radius: 8px; box-shadow: 0 5px 13px rgba(64, 128, 158, .16); font-size: 12px; font-weight: 800; white-space: nowrap; }
.edit:hover { filter: brightness(.97); transform: translateY(-1px); }

@media (hover: hover) and (pointer: fine) {
  .kpis article:hover, .kpis article:focus-visible { transform: translateY(-4px); border-color: #bcd8e8; box-shadow: 0 16px 35px rgba(50, 91, 126, .12); }
  .kpis article:hover b { color: #2e6c98; }
  .funnel article:hover, .funnel article:focus-visible { transform: translateY(-3px); border-color: #c5ddeb; box-shadow: 0 12px 25px rgba(53, 96, 132, .09); }
  .funnel article:hover i { filter: saturate(1.15); box-shadow: 0 0 10px rgba(76, 156, 169, .35); }
  .bars .bar-row:hover, .bars .bar-row:focus-visible { background: rgba(232, 244, 251, .68); transform: translateX(3px); }
  .bars .bar:hover { z-index: 8; filter: saturate(1.18); transform: scaleY(1.55); box-shadow: 0 3px 9px rgba(64, 116, 152, .22); }
  .bars .bar:hover::after { opacity: 1; transform: translate(8px, -50%) scale(1); }
  .bars .bar.edge:hover::after { transform: translate(-6px, -50%) scale(1); }
  .donut:hover, .donut:focus-visible { transform: scale(1.035); box-shadow: 0 14px 32px rgba(67, 130, 166, .18); }
  .split > div:last-child p:hover, .split > div:last-child p:focus-visible { background: #eef7fb; transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .kpis article:hover, .funnel article:hover, .bars .bar-row:hover, .bars .bar:hover, .donut:hover, .split > div:last-child p:hover { transform: none !important; }
}

.loading { min-height: 450px; display: grid; place-items: center; color: #6f8298; font-size: 15px; }
.toast { position: fixed; z-index: 30; right: 28px; top: 96px; padding: 14px 18px; color: #fff; background: #3d796f; border-radius: 10px; box-shadow: 0 14px 34px rgba(24, 72, 65, .22); font-size: 13px; }
.error { margin-bottom: 16px; padding: 14px 16px; color: #9a474e; background: #fff3f4; border: 1px solid #edd1d4; border-radius: 11px; font-size: 13px; }

.backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 22px; background: rgba(30, 58, 84, .38); backdrop-filter: blur(7px); }
.modal, .login-modal { position: relative; width: min(650px, 100%); padding: 30px; background: rgba(255,255,255,.97); border: 1px solid rgba(219,232,241,.95); border-radius: 20px; box-shadow: 0 28px 80px rgba(28, 58, 84, .25); }
.modal > .close, .login-modal > .close { position: absolute; right: 19px; top: 14px; color: #71859a; background: none; border: 0; font-size: 28px; }
.modal > small { color: var(--blue-deep); font-weight: 700; }
.modal h2 { margin: 6px 0 0; color: #234764; font-size: 23px; }
.modal p { margin: 6px 0 22px; color: #75889b; font-size: 12px; }
.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fields label, .names { display: grid; gap: 8px; color: #596e83; font-size: 12px; }
.fields input { width: 100%; height: 46px; color: #29445f; background: #f9fcfe; border: 1px solid #cbddea; border-radius: 9px; text-align: center; font-size: 17px; font-weight: 800; }
.fields .planned-field input { color: #1f6897; background: #edf7fd; border-color: #9fc8df; }
.names { margin-top: 20px; }
.names textarea { padding: 12px; color: #314a62; background: #fbfdfe; border: 1px solid #cbddea; border-radius: 9px; resize: vertical; }
.hint { margin-top: 15px; padding: 11px 12px; color: #6d8195; background: #f0f6fa; border-left: 3px solid #84acce; font-size: 11px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.actions button { min-width: 94px; height: 42px; color: #62768a; background: #fff; border: 1px solid #d0dfe9; border-radius: 9px; font-size: 13px; font-weight: 700; }
.actions .save { color: #fff; background: linear-gradient(135deg, #4b85bd, #4ba69d); border: 0; }

.login-modal { width: min(440px, 100%); text-align: center; }
.login-icon { width: 58px; height: 58px; margin: 0 auto 15px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #74a9d7, #66b7ad); border-radius: 18px 6px; box-shadow: 0 10px 24px rgba(70, 142, 169, .2); font-size: 24px; }
.login-modal h2 { margin: 0; color: #244864; font-size: 24px; }
.login-modal > p { margin: 8px 0 23px; color: #76899c; font-size: 13px; }
.login-modal label { display: grid; gap: 8px; text-align: left; }
.login-modal label span { color: #536b82; font-size: 13px; font-weight: 700; }
.login-modal input { height: 48px; padding: 0 14px; color: #2d4861; background: #f8fbfd; border: 1px solid #caddea; border-radius: 10px; letter-spacing: .18em; }
.login-submit { width: 100%; height: 46px; margin-top: 16px; color: white; background: linear-gradient(135deg, #4b85bd, #4ba69d); border: 0; border-radius: 10px; font-weight: 800; }
.login-submit:disabled { opacity: .65; cursor: wait; }
.login-modal > small { display: block; margin-top: 14px; color: #8a99a8; font-size: 11px; }
.login-error { margin-top: 12px; padding: 9px; color: #a0454d; background: #fff1f2; border-radius: 8px; font-size: 12px; text-align: left; }

footer { width: min(1460px, calc(100% - 56px)); margin: auto; padding: 20px 0 32px; color: #8395a6; border-top: 1px solid #d9e6ef; font-size: 12px; }

.hidden { display: none !important; }
.state-card { min-height: 420px; display: grid; place-content: center; gap: 14px; color: #6f8298; text-align: center; }
.state-card b { color: #38526d; font-size: 18px; }
.state-card button { justify-self: center; padding: 10px 18px; color: #fff; background: linear-gradient(135deg, #4b85bd, #4ba69d); border: 0; border-radius: 9px; font-weight: 700; }
button:disabled { opacity: .62; cursor: wait; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .funnel { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; }
  .toolbar > div:last-child { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  header { height: 70px; padding: 0 18px; }
  .live { display: none; }
  .wrap { width: calc(100% - 30px); padding-top: 30px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .updated { text-align: left; }
  nav { flex-wrap: wrap; }
  nav button { padding: 12px 9px 14px; font-size: 13px; }
  nav .admin-login { margin-left: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis article.dark { grid-column: span 2; }
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .toolbar > div:last-child > * { flex: 1; min-width: 45%; }
  .toolbar input { width: auto; }
  .fields { grid-template-columns: repeat(2, 1fr); }
  footer { width: calc(100% - 30px); }
}
