/* =========================================================
   云耀造梦共创平台 · 应用层样式
   创作者中心 / 运营后台 / 签署工作台
   ========================================================= */

/* ---------- App chrome ---------- */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: rgba(251, 251, 248, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-nav__inner {
  height: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--gut);
  display: flex;
  align-items: center;
  gap: 24px;
}
.app-nav .brand__mark { width: 30px; height: 30px; }
.app-nav .brand__word { font-size: 15px; letter-spacing: 0.12em; }
.app-nav .brand__sub { margin-top: 3px; font-size: 7px; }
.app-nav__ctx {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}
.app-nav__ctx .mono { font-size: 9.5px; color: var(--muted-2); letter-spacing: 0.12em; }
.app-nav__right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink-soft);
  transition: all 0.2s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--sky);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--sky-wash);
  border: 1px solid var(--sky-pale);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 13px; color: var(--sky-deep);
}
.user-mini { display: flex; align-items: center; gap: 9px; }
.user-mini strong { font-size: 12.5px; font-weight: 500; display: block; line-height: 1.3; }
.user-mini span { display: block; font-family: var(--mono); font-size: 9px; color: var(--muted-2); letter-spacing: 0.08em; }
@media (max-width: 720px) {
  .app-nav__ctx, .user-mini div, .app-nav__right .textlink { display: none; }
}

/* ---------- Console layout ---------- */
.console { background: #f8f9f7; min-height: 100vh; padding-bottom: 80px; }
.console__grid {
  max-width: 1360px;
  margin-inline: auto;
  padding: 30px var(--gut) 0;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}
.side-nav { position: sticky; top: 94px; }
.side-nav__group + .side-nav__group { margin-top: 22px; }
.side-nav__label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 10px 8px;
}
.side-nav a, .side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-left: 2px solid transparent;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: left;
  transition: all 0.18s;
}
.side-nav a:hover, .side-nav button:hover { background: #fff; color: var(--ink); }
.side-nav .is-active {
  background: #fff;
  border-left-color: var(--sky);
  color: var(--ink);
  font-weight: 500;
}
.side-nav .mono { margin-left: auto; font-size: 9.5px; color: var(--muted-2); }
.side-nav__foot {
  margin-top: 26px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}
.side-nav__foot strong { display: block; color: var(--ink); font-weight: 500; font-size: 12px; margin-bottom: 4px; }

/* 创作者中心 · 一级/二级菜单 */
.side-nav .nav-group { margin-top: 14px; }
.side-nav .nav-group:first-child { margin-top: 0; }
.side-nav .nav-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 10px 6px;
  background: none;
  border: 0;
  border-left: 0;
  cursor: pointer;
  text-align: left;
}
.side-nav .nav-group__head:hover { background: none; color: var(--ink); }
.side-nav .nav-group__title {
  font-family: var(--serif);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.side-nav .nav-group__hint {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  opacity: 0.75;
}
.side-nav .nav-group__chev { margin-left: auto; color: var(--muted-2); transition: transform 0.2s ease; }
.side-nav .nav-group:not(.is-open) .nav-group__chev { transform: rotate(-90deg); }
.side-nav .nav-group__body { display: grid; gap: 2px; }
.side-nav .nav-group:not(.is-open) .nav-group__body { display: none; }

/* 创作者中心 · 快捷操作 */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.quick-action {
  position: relative;
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.quick-action:hover { border-color: var(--sky); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(22, 50, 79, 0.06); }
.quick-action__k { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink); }
.quick-action__d { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.quick-action__i { position: absolute; right: 12px; top: 12px; font-family: var(--mono); font-size: 9px; color: var(--muted-2); }
@media (max-width: 980px) { .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 980px) {
  .console__grid { grid-template-columns: 1fr; gap: 20px; }
  .side-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .side-nav__group { display: contents; }
  .side-nav__label, .side-nav__foot { display: none; }
  .side-nav a, .side-nav button { width: auto; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .side-nav .is-active { border-bottom-color: var(--sky); }
  .side-nav .mono { display: none; }
  .side-nav .nav-group, .side-nav .nav-group__body, .side-nav .nav-group:not(.is-open) .nav-group__body { display: contents; }
  .side-nav .nav-group__head { display: none; }
}

/* ---------- Console: state banner ---------- */
.state-hero {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 30px);
}
.state-hero::before {
  content: "";
  position: absolute;
  right: -40px; top: -60px;
  width: 260px; height: 260px;
  border: 1px dashed var(--sky-pale);
  border-radius: 50%;
  opacity: 0.9;
  pointer-events: none;
}
.state-hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  position: relative;
}
.state-code-big {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--spark);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  border-radius: var(--r-sm);
}
.state-code-big::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.state-hero h1 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.25; }
.state-hero__sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.state-hero__right { margin-left: auto; display: flex; gap: 26px; }
.state-hero__right div span { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--muted-2); text-transform: uppercase; }
.state-hero__right div strong { font-size: 12.5px; font-weight: 500; }

.mini-timeline {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
  margin-top: 26px;
  position: relative;
}
.mini-timeline::before {
  content: "";
  position: absolute;
  left: 10px; right: 10px; top: 5px;
  border-top: 1px dashed var(--line-2);
}
.mt-step { position: relative; padding-top: 18px; }
.mt-step__dot {
  position: absolute;
  top: 0; left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line-2);
}
.mt-step.is-done .mt-step__dot { background: var(--sky); border-color: var(--sky); }
.mt-step.is-skipped .mt-step__dot { border-style: dashed; background: var(--paper); }
.mt-step.is-skipped .mt-step__name { color: var(--muted-2); }
.mt-step.is-now .mt-step__dot { background: var(--spark); border-color: var(--spark-deep); box-shadow: 0 0 0 4px rgba(246, 226, 122, 0.3); }
.mt-step__code { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); letter-spacing: 0.08em; }
.mt-step.is-done .mt-step__code, .mt-step.is-now .mt-step__code { color: var(--sky-deep); }
.mt-step__name { font-size: 11px; color: var(--muted); margin-top: 1px; }
.mt-step.is-now .mt-step__name { color: var(--ink); font-weight: 500; }
@media (max-width: 720px) {
  .mini-timeline { grid-template-columns: repeat(4, 1fr); row-gap: 14px; }
  .mini-timeline::before { display: none; }
  .state-hero__right { margin-left: 0; width: 100%; }
}

/* ---------- Metrics ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 18px;
}
.metric { background: #fff; padding: 18px 20px; }
.metric__k { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric__v { margin-top: 8px; font-family: var(--mono); font-size: clamp(20px, 2.2vw, 27px); letter-spacing: -0.03em; }
.metric__v small { font-size: 12px; color: var(--muted); margin-left: 2px; }
.metric__d { margin-top: 5px; font-family: var(--mono); font-size: 10.5px; color: var(--green); }
.metric__d.is-down { color: var(--red); }
@media (max-width: 880px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .metric-grid { grid-template-columns: 1fr; } }

/* ---------- Panels ---------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-top: 18px;
}
.panel__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel__title { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.panel__title .mono { font-family: var(--mono); font-size: 10px; color: var(--muted-2); margin-left: 8px; letter-spacing: 0.08em; }
.panel__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.panel__body { padding: 20px; }
.panel__foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--muted); }

.two-col { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 18px; align-items: start; }
.two-col > .panel:first-child { margin-top: 18px; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Tabs ---------- */
.tabbar {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-top: 26px;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar button {
  position: relative;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tabbar button .mono { font-size: 9px; color: var(--muted-2); margin-right: 5px; }
.tabbar button:hover { color: var(--ink); }
.tabbar button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tabbar button[aria-selected="true"] .mono { color: var(--sky-deep); }

.tabpanel[hidden] { display: none; }
.tabpanel { animation: fadein 0.35s var(--ease); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------- TODOs ---------- */
.todo { display: flex; align-items: flex-start; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo:first-child { padding-top: 4px; }
.todo__icon {
  flex: none;
  width: 30px; height: 30px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  display: grid; place-items: center;
  color: var(--sky-deep);
  font-family: var(--mono); font-size: 10px;
  background: var(--paper-blue);
}
.todo__main { min-width: 0; flex: 1; }
.todo__title { font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo__meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.todo__meta .mono { font-size: 10px; color: var(--muted-2); }
.todo__go {
  flex: none;
  align-self: center;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--r);
  transition: all 0.2s;
}
.todo:hover .todo__go { background: var(--ink); border-color: var(--ink); color: var(--spark); }

/* ---------- IP rows ---------- */
.ip-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ip-row:last-child { border-bottom: 0; }
.ip-row img { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--line-2); flex: none; }
.ip-row__main { flex: 1; min-width: 0; }
.ip-row__name { font-size: 13.5px; font-weight: 500; }
.ip-row__meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ip-row__fig { text-align: right; font-family: var(--mono); font-size: 12px; }
.ip-row__fig span { display: block; font-size: 10px; color: var(--muted-2); }

/* ---------- Chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 132px; padding-top: 10px; }
.chart__bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.chart__bar i {
  display: block;
  width: 100%;
  max-width: 34px;
  background: linear-gradient(180deg, var(--sky-pale), var(--sky-wash));
  border-top: 2px solid var(--sky);
  transition: height 0.8s var(--ease);
}
.chart__bar.is-peak i { background: linear-gradient(180deg, var(--spark), #fdf6cf); border-top-color: var(--spark-deep); }
.chart__bar span { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); }
.chart__bar b { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--ink-soft); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  white-space: nowrap;
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover { background: var(--sky-wash); }
.tbl .strong { color: var(--ink); font-weight: 500; }
.tbl .mono { font-size: 11px; }
.tbl .right { text-align: right; }
.tbl .nowrap { white-space: nowrap; }
.tbl tr.is-selected { background: var(--sky-wash); box-shadow: inset 2px 0 0 var(--sky); }

.pager { display: flex; align-items: center; gap: 6px; }
.pager button { width: 26px; height: 26px; border: 1px solid var(--line); font-size: 11px; border-radius: 2px; }
.pager button:hover { border-color: var(--ink); }
.pager button.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Contract list ---------- */
.doc-list { border-top: 1px solid var(--line); }
.doc-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.doc-row__icon {
  width: 38px; height: 46px;
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  color: var(--sky-deep);
  background: var(--paper-blue);
  flex: none;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.06em;
}
.doc-row__main { flex: 1; min-width: 0; }
.doc-row__name { font-size: 13.5px; font-weight: 500; }
.doc-row__meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.doc-row__files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.04em;
  border: 1px solid var(--line);
  padding: 3px 7px;
  color: var(--muted);
  background: var(--paper);
}
.file-tag:hover { border-color: var(--sky); color: var(--sky-deep); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 46px 20px; }
.empty__art { width: 88px; height: 60px; margin: 0 auto 16px; color: var(--sky-pale); }
.empty h4 { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.empty p { margin: 6px auto 0; max-width: 34ch; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.empty .btn { margin-top: 16px; }

/* ---------- Admin shell ---------- */
.admin { background: #f5f6f4; min-height: 100vh; }
.admin__shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.admin-side {
  background: #101820;
  color: rgba(251, 251, 248, 0.68);
  padding: 20px 14px 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.admin-side .brand { padding: 0 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.admin-side .brand .brand__mark--img { mix-blend-mode: normal; width: 54px; height: 38px; object-fit: cover; object-position: center top; }
.admin-side .brand__word { color: var(--paper); font-size: 15px; letter-spacing: 0.12em; }
.admin-side .brand__sub { color: rgba(251, 251, 248, 0.34); }
.admin-side .brand__mark { width: 30px; height: 30px; color: var(--sky-pale); }
.admin-side__label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(251, 251, 248, 0.32);
  padding: 20px 10px 8px;
}
.admin-side nav a, .admin-side nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  font-size: 12.5px;
  color: rgba(251, 251, 248, 0.66);
  border-left: 2px solid transparent;
  border-radius: var(--r-sm);
  text-align: left;
  transition: all 0.18s;
}
.admin-side nav a:hover, .admin-side nav button:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.admin-side nav .is-active { color: #fff; background: rgba(29, 155, 240, 0.16); border-left-color: var(--sky); }
.admin-side nav .mono { margin-left: auto; font-size: 9.5px; color: rgba(251, 251, 248, 0.4); }
.admin-side nav .is-active .mono { color: var(--spark); }

/* 运营后台 · 一级/二级菜单 */
.admin-side .nav-group { margin: 0 0 6px; }
.admin-side .nav-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px 4px;
  background: none;
  border: 0;
  border-left: 0;
  cursor: pointer;
  text-align: left;
  color: rgba(251, 251, 248, 0.42);
  transition: color 0.18s;
}
.admin-side .nav-group__head:hover { background: none; color: rgba(251, 251, 248, 0.8); }
.admin-side .nav-group__title { font-family: var(--serif); font-size: 12px; letter-spacing: 0.1em; }
.admin-side .nav-group__hint {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(251, 251, 248, 0.26);
}
.admin-side .nav-group__chev { margin-left: auto; color: rgba(251, 251, 248, 0.3); transition: transform 0.2s ease; }
.admin-side .nav-group:not(.is-open) .nav-group__chev { transform: rotate(-90deg); }
.admin-side .nav-group__body { display: grid; gap: 2px; }
.admin-side .nav-group:not(.is-open) .nav-group__body { display: none; }

/* 运营后台 · 分组标题 */
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.sec-head .mono { font-size: 9.5px; letter-spacing: 0.14em; color: var(--muted-2); }
.sec-head h3 { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--ink); }
.sec-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.admin-side__foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 10.5px; line-height: 1.7; color: rgba(251, 251, 248, 0.4); }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-top {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  background: rgba(245, 246, 244, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 18px;
  padding-inline: 26px;
}
.admin-top h1 { font-family: var(--serif); font-size: 17px; font-weight: 600; white-space: nowrap; }
.admin-top__meta { font-family: var(--mono); font-size: 10px; color: var(--muted-2); letter-spacing: 0.06em; }
.admin-top .search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  background: #fff;
  padding: 0 10px;
  height: 34px;
  border-radius: var(--r);
  width: min(260px, 26vw);
}
.admin-top .search input { border: 0; background: none; outline: none; font-size: 12px; width: 100%; }
.admin-top .search svg { color: var(--muted-2); flex: none; }
.admin-body { padding: 24px 26px 64px; min-width: 0; }
.admin-view[hidden] { display: none; }
.admin-view { animation: fadein 0.3s var(--ease); }

.admin-page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.admin-page-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.admin-page-head p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.admin-page-head__actions { display: flex; gap: 8px; }

.demo-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  border: 1px solid #f0e3bf; background: #fdf7e7; color: var(--amber);
  padding: 3px 8px; border-radius: 2px;
}
.state-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 14px; }
@media (max-width: 720px) { .state-rules { grid-template-columns: 1fr; gap: 12px; } }

.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
}
.filterbar__spacer { margin-left: auto; }
.filter-select {
  border: 1px solid var(--line-2);
  background: #fff;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: var(--r-sm);
}

.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.admin-stat { background: #fff; border: 1px solid var(--line); padding: 18px 20px; border-radius: var(--r); }
.admin-stat__k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--muted-2); text-transform: uppercase; }
.admin-stat__v { font-family: var(--mono); font-size: 26px; margin-top: 6px; letter-spacing: -0.03em; }
.admin-stat__d { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 1080px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .admin__shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    overflow-x: auto;
  }
  .admin-side .brand { border: 0; padding: 0 14px 0 0; margin-right: 6px; flex: none; }
  .admin-side .brand__sub { display: none; }
  .admin-side__label, .admin-side__foot { display: none; }
  .admin-side nav { display: flex; gap: 4px; }
  .admin-side nav a, .admin-side nav button { width: auto; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; padding: 7px 10px; }
  .admin-side nav .is-active { border-bottom-color: var(--sky); }
  .admin-side nav .mono { display: none; }
  .admin-side .nav-group, .admin-side .nav-group__body, .admin-side .nav-group:not(.is-open) .nav-group__body { display: contents; }
  .admin-side .nav-group__head { display: none; }
  .admin-top { padding-inline: 16px; }
  .admin-top .search { display: none; }
  .admin-body { padding: 18px 16px 48px; }
}

/* ---------- Drawer ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 24, 32, 0.42);
  backdrop-filter: blur(2px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.overlay.is-on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 94vw);
  background: var(--paper);
  z-index: 90;
  transform: translateX(102%);
  transition: transform 0.42s var(--ease);
  display: flex;
  flex-direction: column;
  box-shadow: -30px 0 60px -40px rgba(0, 0, 0, 0.4);
}
.drawer.is-on { transform: none; }
.drawer__head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
}
.drawer__head h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.drawer__head .mono { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.06em; }
.drawer__close { margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.drawer__close:hover { border-color: var(--ink); }
.drawer__body { padding: 22px 24px 32px; overflow-y: auto; flex: 1; }
.drawer__foot { padding: 14px 24px; border-top: 1px solid var(--line); background: #fff; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.detail-block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.detail-block:first-child { padding-top: 0; }
.detail-block__k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-soft); }
.kv dd .mono { font-size: 11.5px; }

.material-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.material { border: 1px solid var(--line); background: #fff; }
.material img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.material span { display: block; padding: 6px 8px; font-size: 10.5px; color: var(--muted); border-top: 1px solid var(--line); }

.review-form { background: #fff; border: 1px solid var(--line-2); padding: 16px; margin-top: 10px; }
.review-form h4 { font-family: var(--serif); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.review-form .field + .field { margin-top: 12px; }
.review-form .btn { margin-top: 14px; }
.review-form fieldset[disabled] { opacity: 0.55; }
.review-form fieldset[disabled] :is(input, select, textarea, button) { cursor: not-allowed; }
.review-form.is-locked .checkline { opacity: 0.5; pointer-events: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  z-index: 120;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--r);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--ease);
  max-width: 92vw;
}
.toast::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--spark); flex: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Sign workbench ---------- */
.sign-page { background: #f3f5f4; min-height: 100vh; }
.sign-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.sign-head__inner {
  max-width: 1320px;
  margin-inline: auto;
  padding: 0 var(--gut);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.sign-head__secure { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.sign-head__secure svg { color: var(--green); }

.sign-steps { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: #fff; }
.sign-steps__inner { max-width: 1320px; margin-inline: auto; padding-inline: var(--gut); display: flex; width: 100%; }
.sstep {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 22px 12px 0;
  margin-right: 22px;
  font-size: 12px;
  color: var(--muted-2);
  position: relative;
}
.sstep::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 12px;
  border-top: 1px solid var(--line-2);
}
.sstep:last-child::after { display: none; }
.sstep__n {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  flex: none;
}
.sstep.is-done { color: var(--sky-deep); }
.sstep.is-done .sstep__n { background: var(--sky); border-color: var(--sky); color: #fff; }
.sstep.is-now { color: var(--ink); font-weight: 500; }
.sstep.is-now .sstep__n { border-color: var(--ink); background: var(--spark); color: var(--ink); box-shadow: 0 0 0 3px rgba(246, 226, 122, 0.28); }
@media (max-width: 720px) {
  .sstep { font-size: 10.5px; padding-right: 12px; margin-right: 12px; }
  .sstep__label { display: none; }
  .sign-head__secure span { display: none; }
}

.sign-layout {
  max-width: 1320px;
  margin-inline: auto;
  padding: 26px var(--gut) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 26px;
  align-items: start;
}
.sign-doc-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: start; }

.contract-toc { position: sticky; top: 96px; }
.contract-toc__label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--muted-2); text-transform: uppercase; margin-bottom: 10px; }
.contract-toc a {
  display: block;
  padding: 5px 0 5px 10px;
  border-left: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--muted);
  transition: all 0.2s;
  line-height: 1.5;
}
.contract-toc a:hover { color: var(--ink); }
.contract-toc a.is-active { color: var(--sky-deep); border-left-color: var(--sky); font-weight: 500; }

.contract {
  background: #fff;
  border: 1px solid var(--line-2);
  padding: clamp(24px, 4vw, 56px);
  box-shadow: 0 24px 60px -50px rgba(9, 52, 80, 0.5);
}
.contract__head { text-align: center; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.contract__title { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 28px); letter-spacing: 0.12em; font-weight: 600; }
.contract__no { margin-top: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.1em; }
.contract__parties { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; font-size: 12px; text-align: left; }
.contract__parties b { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--muted-2); font-weight: 400; margin-bottom: 4px; text-transform: uppercase; }
.contract h3 {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  margin: 26px 0 8px;
  padding-left: 10px;
  border-left: 2px solid var(--sky);
  scroll-margin-top: 120px;
}
.contract p { font-size: 12.5px; color: var(--ink-soft); line-height: 2; margin-top: 6px; text-align: justify; }
.contract .hl { background: linear-gradient(180deg, transparent 62%, rgba(246, 226, 122, 0.7) 62%); }
.contract__signzone {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  font-size: 11.5px;
  color: var(--muted);
}
.contract__stamp {
  margin-top: 10px;
  height: 62px;
  border: 1px dashed var(--line-2);
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.sign-panel {
  position: sticky;
  top: 96px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
}
.sign-panel__head { padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--paper-blue); }
.sign-panel__head h2 { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.sign-panel__head p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.sign-panel__body { padding: 18px 20px; }
.sign-panel__body .field + .field { margin-top: 14px; }
.sign-panel__body .checkline { margin-top: 14px; font-size: 11.5px; }
.sign-panel__foot { padding: 14px 20px 18px; border-top: 1px solid var(--line); }

.verify-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.verify-row:last-of-type { border-bottom: 0; }
.verify-row__state { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.verify-row.is-ok .verify-row__state { color: var(--green); }
.verify-row__check {
  width: 18px; height: 18px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  color: transparent;
}
.verify-row.is-ok .verify-row__check { background: var(--green); border-color: var(--green); color: #fff; }

.sig-pad {
  position: relative;
  border: 1px dashed var(--line-2);
  background: var(--paper-blue);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.sig-pad canvas { width: 100%; height: 132px; touch-action: none; cursor: crosshair; }
.sig-pad__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  color: var(--muted-2);
  pointer-events: none;
  transition: opacity 0.2s;
}
.sig-pad.has-ink .sig-pad__hint { opacity: 0; }
.sig-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 10.5px; color: var(--muted-2); }
.sig-tools button { color: var(--muted); border-bottom: 1px solid var(--line-2); }
.sig-tools button:hover { color: var(--red); border-color: var(--red); }

.panel-note { font-size: 10.5px; color: var(--muted-2); line-height: 1.7; margin-top: 12px; }
.panel-note b { color: var(--muted); font-weight: 500; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal.is-on { visibility: visible; opacity: 1; }
.modal__veil { position: absolute; inset: 0; background: rgba(10, 24, 32, 0.5); backdrop-filter: blur(3px); }
.modal__box {
  position: relative;
  width: min(520px, 100%);
  background: var(--paper);
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  padding: 30px;
  transform: translateY(14px) scale(0.99);
  transition: transform 0.35s var(--ease);
  max-height: 88vh;
  overflow-y: auto;
}
.modal.is-on .modal__box { transform: none; }
.modal__icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--sky-wash);
  border: 1px solid var(--sky-pale);
  display: grid; place-items: center;
  color: var(--sky-deep);
  margin-bottom: 16px;
}
.modal h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.modal p { margin-top: 8px; font-size: 13px; color: var(--ink-soft); line-height: 1.8; }
.modal__list { margin-top: 18px; border-top: 1px solid var(--line); }
.modal__list li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.modal__list li .mono { margin-left: auto; font-size: 10px; color: var(--muted-2); }
.modal__list li svg { color: var(--green); flex: none; }
.modal__actions { margin-top: 22px; display: flex; gap: 10px; }
.modal__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); letter-spacing: 0.04em; }

@media (max-width: 1080px) {
  .sign-layout { grid-template-columns: 1fr; }
  .sign-panel { position: static; }
  .sign-doc-wrap { grid-template-columns: 1fr; }
  .contract-toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .contract-toc__label { width: 100%; }
  .contract-toc a { border-left: 0; border-bottom: 1px solid var(--line); padding: 2px 0; }
  .contract-toc a.is-active { border-bottom-color: var(--sky); }
}
@media (max-width: 620px) {
  .contract__parties { grid-template-columns: 1fr; }
  .contract__signzone { grid-template-columns: 1fr; }
  .sign-head__inner { gap: 10px; }
}

/* ---------- Misc ---------- */
.stack-sm > * + * { margin-top: 10px; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.no-wrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.small { font-size: 11.5px; color: var(--muted); }
.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
