:root {
  --bg1: #e8f0ea;
  --bg2: #d5e4ef;
  --ink: #1c2b24;
  --muted: #5a6b62;
  --brand: #1f6b4a;
  --brand-dark: #155338;
  --card: rgba(255, 255, 255, 0.88);
  --line: #c5d5cc;
  --danger: #b42318;
  --ok: #067647;
  --page-width: 1580px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #f7fff8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dff0ff 0%, transparent 50%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(16px, calc((100% - var(--page-width)) / 2));
  border-bottom: none;
  background: linear-gradient(90deg, #145a9e 0%, #1f6fbf 45%, #2b82d6 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(20, 70, 130, 0.22);
  min-height: 64px;
  box-sizing: border-box;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}
.brand img { width: 28px; height: 28px; }
.brand img.brand-logo {
  width: auto;
  height: 36px;
  max-width: 180px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  padding: 2px 6px;
}
.topbar nav { display: flex; gap: 16px; align-items: center; color: #fff; flex-wrap: wrap; }
.topbar nav a,
.topbar nav span { color: #fff; }
.topbar nav > a,
.topbar nav .nav-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  text-decoration: none;
  border: none;
  border-bottom: none;
  padding: 0;
  line-height: 1.25;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  background: transparent;
  font: inherit;
  color: #fff;
  position: relative;
}
/* 预留加粗宽度，避免切换模块时顶栏左右跳动（不占可视高度，无空行） */
.topbar nav > a[data-nav]::before,
.topbar nav .nav-menu-toggle[data-nav]::before {
  content: attr(data-nav);
  font-weight: 700;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
}
.topbar nav > a:hover,
.topbar nav .nav-menu-toggle:hover {
  color: #dcecff;
  text-decoration: none !important;
}
.topbar nav > a.active,
.topbar nav .nav-menu.active > .nav-menu-toggle {
  font-weight: 700;
  text-decoration: none !important;
}
.topbar nav > a,
.topbar nav .nav-menu-toggle {
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none;
}
.topbar nav a[href="/logout"] {
  font-weight: 400;
}
.topbar nav a[href="/logout"]::before {
  content: none;
}
.user-menu .nav-menu-panel {
  left: auto;
  right: 0;
}
/* 营业执照下拉菜单（图示风格） */
.nav-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-menu-caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #fff;
  margin-top: 1px;
  flex-shrink: 0;
}
.nav-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 132px;
  padding: 4px 0;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  z-index: 1200;
}
.nav-menu-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.nav-menu:hover .nav-menu-panel,
.nav-menu:focus-within .nav-menu-panel,
.nav-menu.open .nav-menu-panel {
  display: block;
}
.nav-menu-panel a {
  display: block;
  width: 100%;
  padding: 8px 18px;
  color: #333 !important;
  text-decoration: none !important;
  border: none !important;
  font-weight: 400 !important;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  box-sizing: border-box;
  white-space: nowrap;
}
.nav-menu-panel a:hover {
  background: #f0f7ff;
  color: #1677ff !important;
}
.nav-menu-panel a.active {
  background: #e8f3ff;
  color: #1677ff !important;
  font-weight: 600 !important;
}
.version { font-size: 12px; color: rgba(255, 255, 255, 0.88); }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap {
  flex: 1 1 auto;
  width: min(var(--page-width), calc(100% - 32px));
  max-width: var(--page-width);
  margin: 24px auto;
}
.site-footer {
  flex-shrink: 0;
  text-align: center;
  padding: 18px 16px 26px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}
.site-footer div + div {
  margin-top: 2px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(28, 43, 36, 0.06);
}

h1, h2, h3 { margin: 0 0 12px; }
h1 { font-size: 26px; letter-spacing: 0.5px; }
h2 { font-size: 18px; }
.sub { color: var(--muted); margin-bottom: 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}
.grid-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
#basicLegalSlot:empty {
  display: none !important;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
/* 单选/复选不得拉满宽度，否则会变成上下排列或选项跑到右侧 */
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  height: auto;
  padding: 0;
  margin: 0 6px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  vertical-align: middle;
  flex-shrink: 0;
}
input[type="hidden"] {
  width: auto;
  padding: 0;
  border: none;
}
textarea { min-height: 88px; resize: vertical; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #eef4f0; color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.table th, .table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: top;
}
.table th { background: #f3f8f5; font-size: 13px; }

/* 股东信息：复用人员信息 people-card 视觉 */
#shareTable.table,
#shareTable.table td {
  border: none;
  padding: 0;
  background: transparent;
}
#shareTable.table tfoot td {
  padding: 4px 0 0;
}
.share-card.people-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: default;
  user-select: text;
}
.share-line {
  display: grid;
  gap: 12px 14px;
  align-items: start;
}
.share-line.line2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
  margin-bottom: 0;
}
.share-line.line3 {
  grid-template-columns: 1fr;
}
.share-field > label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.share-card-actions.people-card-actions {
  justify-content: flex-start;
  margin-top: 0;
}
#shareSumBar.share-sum-bar {
  margin-top: 4px;
  margin-bottom: 0;
  padding: 4px 2px 0;
}
.share-card .people-card-head .btn-del {
  position: static;
  margin-left: 0;
  padding: 6px 12px;
  font-size: 13px;
}
.term-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.term-inline select {
  flex: 1 1 160px;
  min-width: 160px;
}
.term-inline input[type="date"] {
  flex: 0 0 auto;
  width: 150px;
}
.share-methods {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.share-method-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
}
.share-method-row > span {
  font-size: 13px;
  color: var(--ink);
}
.share-method-row input[data-method-amt] {
  width: 88px;
  padding: 10px 12px;
  font-size: inherit;
}
.method-sum-tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.person-combo {
  position: relative;
  display: block;
}
.person-combo > input {
  width: 100%;
  padding-right: 42px;
}
.person-combo-pick {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 38px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: #f3f8f5;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  appearance: auto;
}
.people-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.people-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.people-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.people-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.people-card-title {
  font-weight: 600;
  font-size: 14px;
}
.people-chairman-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.people-card-pick {
  margin-bottom: 10px;
  max-width: 320px;
}
.people-card-pick label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.people-card-pick select {
  width: 100%;
}
.people-fields {
  margin-bottom: 8px;
}
.people-fields-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 14px;
  margin-bottom: 8px;
}
.people-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 8px 0 10px;
  font-size: 13px;
}
.people-roles label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
}
.people-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.people-card-actions .people-add-btn {
  margin-left: auto;
}
.contact-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px 14px;
}
@media (max-width: 900px) {
  .contact-row {
    grid-template-columns: 1fr;
  }
}
.share-sum-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.share-sum-bar b {
  color: var(--ink);
  font-weight: 600;
}
.hist-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.hist-pager .page-info {
  font-size: 13px;
  color: var(--muted);
}
.hist-pager .btn:disabled,
.hist-pager .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.login-page {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(28,43,36,0.1);
  text-align: center;
}
.login-box img { width: 56px; height: 56px; margin-bottom: 10px; }
.login-box .fields { text-align: left; margin-top: 18px; }
.login-box .fields > div { margin-bottom: 12px; }
.login-box .version { color: var(--muted); }
.error {
  color: var(--danger);
  background: #fee4e2;
  border: 1px solid #fecdca;
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 10px;
}
.ok {
  color: var(--ok);
  background: #eaf8ef;
  border: 1px solid #abe2c0;
  padding: 10px 12px;
  border-radius: 8px;
  word-break: break-all;
}

.modal-wide { max-width: 720px; width: 92vw; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 26, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 20px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}
.modal h3 { margin-bottom: 8px; }
.modal .msg { color: var(--muted); white-space: pre-wrap; line-height: 1.5; word-break: break-all; }
.progress-wrap { margin-top: 14px; }
.progress-bar {
  height: 10px;
  background: #e6eee9;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress-bar-inner {
  height: 100%;
  width: 30%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1f6b4a, #3aa876, #1f6b4a);
  background-size: 200% 100%;
  animation: progress-move 1.2s linear infinite;
  transition: width 0.25s ease;
}
.progress-bar-inner.determinate {
  animation: none;
  background: #1f6b4a;
  background-size: auto;
}
@keyframes progress-move {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.progress-text {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.folder-modal { width: min(900px, 100%); }
.preview-modal {
  width: calc(100vw - 24px);
  max-width: none;
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  padding: 12px 14px 10px;
  box-sizing: border-box;
}
.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.preview-header img {
  width: 28px;
  height: 28px;
}
.preview-header h3 {
  margin: 0;
  font-size: 18px;
}
.preview-close-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: auto;
  min-width: 72px;
}
.preview-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  word-break: break-all;
  flex-shrink: 0;
}
.preview-status {
  font-size: 13px;
  color: var(--brand-dark);
  margin-bottom: 8px;
  min-height: 1.2em;
  flex-shrink: 0;
}
.preview-body {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  height: auto;
}
.preview-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  overflow: auto;
  padding: 6px;
  height: 100%;
  min-height: 0;
}
.preview-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 4px;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
}
.preview-list-item:hover {
  background: #eaf4ee;
}
.preview-list-item.active {
  background: #dff0e6;
  border-color: #b7d7c4;
}
.preview-list-item .tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
}
.preview-frame-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}
.preview-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
  padding: 20px;
  text-align: center;
  background: #fff;
  white-space: pre-wrap;
  line-height: 1.5;
}
.preview-empty.hidden { display: none; }
.preview-pending-msg {
  white-space: pre-wrap;
  line-height: 1.5;
}
.preview-pending-progress {
  width: min(320px, 90%);
  margin-top: 0;
}
.preview-actions {
  margin-top: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .preview-modal {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
    padding: 10px;
  }
  .preview-body {
    grid-template-columns: 1fr;
    grid-template-rows: 140px 1fr;
  }
  .preview-list {
    max-height: 140px;
  }
}
.folder-drives {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.folder-path {
  font-size: 13px;
  color: var(--ink);
  background: #f3f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  margin-bottom: 8px;
}
.folder-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.folder-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid #eef3f0;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}
.folder-item:hover { background: #eef7f1; }
.folder-item:last-child { border-bottom: none; }
.chips {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 4px;
  align-items: center;
}
label.chip,
.chip {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  white-space: nowrap !important;
  color: var(--ink);
  font-weight: normal;
  line-height: 1.4;
  writing-mode: horizontal-tb !important;
}
label.chip > input[type="radio"],
label.chip > input[type="checkbox"],
.chip > input[type="radio"],
.chip > input[type="checkbox"] {
  display: inline-block !important;
  width: 16px !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 16px !important;
  align-self: center;
  accent-color: var(--brand);
}
label.chip > span,
.chip > span {
  display: inline !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  line-height: 1.4;
}
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip.active input {
  accent-color: #fff;
}

.biz-select-line {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.biz-select-sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
  flex: 0 0 auto;
}

.change-pair-panel .change-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
.change-pair-panel .change-pair input[readonly],
.change-pair-panel .change-pair textarea[readonly] {
  background: #f3f6f4;
  color: #3a4a42;
}
.chg-scope-box {
  height: 280px !important;
  min-height: 280px !important;
  max-height: 280px !important;
  resize: none;
  box-sizing: border-box;
}
#scopeWrap textarea#business_scope {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
  resize: vertical;
  box-sizing: border-box;
}
.chg-name-label {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.chg-name-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
  font-weight: normal;
}
.chg-name-meta .luck-blue {
  color: #1a5fb4;
  font-weight: 700;
}
.chg-name-meta .luck-red {
  color: #c01c28;
  font-weight: 700;
}
@media (max-width: 900px) {
  .change-pair-panel .change-pair {
    grid-template-columns: 1fr;
  }
}

.path-cell {
  max-width: 720px;
  word-break: break-all;
}

@media (max-width: 1580px) {
  .wrap {
    width: calc(100% - 32px);
  }
}

@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .people-fields-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-line.line2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .grid, .grid-3 { grid-template-columns: 1fr; }
  .people-fields-4 { grid-template-columns: 1fr; }
  .share-line.line2 { grid-template-columns: 1fr; }
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
    flex-wrap: wrap;
  }
}

.file-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.file-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.wm-options .wm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.wm-options .wm-label {
  color: var(--muted);
}
.wm-options .wm-gap {
  margin-left: 8px;
}
.wm-options.wm-disabled {
  opacity: 0.55;
}
.wm-color-row {
  align-items: center;
}
input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.wm-color-hex {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: var(--ink);
  margin: 0;
}
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.id-merge-status {
  margin: 14px 0 4px;
  color: var(--muted);
}

.id-merge-foot {
  margin-top: 16px;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.modal-title-row h3 {
  margin: 0;
  flex: 1;
}
.modal-icon {
  width: 24px;
  height: 24px;
}

.feedback-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}
.feedback-hint {
  margin: 8px 0 14px;
  font-size: 13px;
}
.feedback-form {
  display: grid;
  gap: 12px;
}
.feedback-form textarea {
  min-height: 110px;
  resize: vertical;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.feedback-attach-block {
  margin-top: 10px;
}
.feedback-attach-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.feedback-upload-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.feedback-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f7faf8;
}
.feedback-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feedback-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.feedback-list-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.feedback-list-thumbs a {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.feedback-list-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feedback-lightbox-mask {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.feedback-lightbox-mask.show {
  display: flex;
}
.feedback-lightbox-mask img {
  max-width: min(92vw, 960px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  background: #111;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.feedback-actions {
  justify-content: flex-end;
  margin-top: 14px;
}
.feedback-fab {
  position: fixed;
  right: 28px;
  bottom: 88px;
  z-index: 900;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 24px rgba(31, 107, 74, 0.35);
  cursor: pointer;
}
.feedback-fab:hover {
  background: var(--brand-dark);
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.feedback-table th,
.feedback-table td {
  font-size: 13px;
  vertical-align: top;
}
.feedback-table td .feedback-status {
  display: inline;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.feedback-content-cell {
  max-width: 360px;
  white-space: pre-wrap;
  word-break: break-word;
}
.feedback-status.pending { color: #9a6700; font-weight: 600; }
.feedback-status.ok { color: var(--ok); font-weight: 600; }
.feedback-status.manual { color: #b42318; font-weight: 600; }

.id-merge-preview-panel {
  display: none;
}
.id-merge-preview-panel.is-open {
  display: block;
}
.id-merge-preview-panel > .modal-title-row h2 {
  margin: 0;
  font-size: 18px;
  flex: 1;
}
.id-merge-preview-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 520px;
}
.id-merge-preview-wm {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 14px;
  overflow: auto;
}
.id-merge-preview-wm .wm-block {
  margin-bottom: 14px;
}
.id-merge-preview-wm .wm-block:last-child {
  margin-bottom: 0;
}
.id-merge-preview-wm .wm-block > label {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.id-merge-preview-wm .dpi-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.id-merge-preview-view {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-zoom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.preview-zoom-bar .btn {
  padding: 4px 10px;
  min-width: 36px;
}
#zoomLabel {
  min-width: 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
}
.id-merge-preview-stage {
  position: relative;
  background: #f5f7fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  overflow: auto;
  height: min(70vh, 720px);
  user-select: none;
}
.preview-canvas {
  position: relative;
  margin: 0 auto;
  display: block;
}
.preview-canvas > #previewImage {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  max-width: none;
}
.preview-stamp {
  position: absolute;
  cursor: grab;
  z-index: 2;
  max-width: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.preview-stamp.dragging {
  cursor: grabbing;
}
.preview-dl-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.id-merge-archive-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.id-merge-archive-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}
.id-merge-archive-item .name {
  flex: 1 1 220px;
  font-weight: 600;
  word-break: break-all;
}
.id-merge-archive-item .actions {
  margin: 0;
  gap: 8px;
}
.private-bank-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}
.contract-preview-frame-wrap {
  min-height: 70vh;
  padding: 0;
}
.contract-preview-frame-wrap iframe {
  width: 100%;
  height: 72vh;
  border: 0;
  background: #fff;
}
@media (max-width: 900px) {
  .private-bank-row {
    grid-template-columns: 1fr;
  }
}
.id-merge-archive-preview-modal {
  width: min(96vw, 980px);
  max-height: 94vh;
  overflow: auto;
}
.id-merge-archive-preview-body {
  text-align: center;
  background: #f5f7fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  overflow: auto;
  max-height: 78vh;
}
.id-merge-archive-preview-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .id-merge-preview-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .id-merge-preview-wm {
    max-height: 280px;
  }
  .id-merge-preview-stage {
    height: min(55vh, 520px);
  }
}

.id-merge-corner-modal {
  width: min(96vw, 960px);
}
.corner-canvas-wrap {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  overflow: auto;
  max-height: 70vh;
}
#cornerCanvas {
  cursor: crosshair;
  max-width: 100%;
}

.dpi-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ========== 个税计算模块 ========== */
.page-tax-calc .tax-section-title {
  margin: 22px 0 12px;
  font-size: 16px;
  color: var(--ink);
  border-bottom: 2px solid var(--brand);
  padding-bottom: 6px;
}
.page-tax-calc .field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.page-tax-calc .tax-child-edu-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 16px;
  margin: 0 0 8px;
}
.page-tax-calc .tax-child-edu-opts > div,
.page-tax-calc .tax-elderly-opts > div,
.page-tax-calc .tax-loan-opts > div {
  min-width: 120px;
}
.page-tax-calc .tax-elderly-opts,
.page-tax-calc .tax-loan-opts,
.page-tax-calc .tax-rent-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 8px;
}
.page-tax-calc .tax-rent-amounts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.page-tax-calc .tax-rent-amounts #btnClearHousingRent {
  margin: 0;
  padding: 6px 12px;
  font-size: inherit;
}
.page-tax-calc .tax-deduct-card.is-muted {
  opacity: 0.55;
}
.page-tax-calc .tax-deduct-card.is-muted input,
.page-tax-calc .tax-deduct-card.is-muted select {
  background: #e9eee9;
  cursor: not-allowed;
}
.page-tax-calc .tax-elderly-opts #elderlyShareWrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 16px;
}
.page-tax-calc .tax-elderly-opts #elderlyShareWrap.tax-hidden {
  display: none !important;
}
.page-tax-calc .tax-deduct-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.page-tax-calc .tax-deduct-card {
  background: #f7fbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 14px 12px;
  box-sizing: border-box;
}
.page-tax-calc .tax-deduct-card > label:first-child {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--ink);
}
@media (max-width: 720px) {
  .page-tax-calc .tax-deduct-grid {
    grid-template-columns: 1fr;
  }
}
.tax-hidden { display: none !important; }
.tax-main-result {
  background: linear-gradient(135deg, var(--brand) 0%, #2d8f65 100%);
  color: #fff;
  border-radius: 10px;
  padding: 22px 20px;
  text-align: center;
  margin: 8px 0 18px;
}
.tax-main-label {
  font-size: 14px;
  opacity: 0.92;
  margin-bottom: 8px;
}
.tax-main-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.tax-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.tax-result-card {
  background: #f3f8f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
}
.tax-result-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.tax-result-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
}
.tax-breakdown {
  background: #f7fbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 8px;
}
.tax-breakdown h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.tax-breakdown-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #e2ebe5;
  font-size: 14px;
}
.tax-breakdown-item:last-child { border-bottom: none; }
.tax-breakdown-total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 2px solid var(--brand);
  border-bottom: none;
  font-weight: 600;
  color: var(--brand);
}
.tax-breakdown-net {
  font-weight: 700;
  font-size: 15px;
  color: var(--brand);
  padding-top: 12px;
  border-top: 2px solid var(--brand);
}
.tax-deduction { color: var(--danger); }
.tax-table-wrap { overflow-x: auto; }
.tax-rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tax-rate-table th,
.tax-rate-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: center;
}
.tax-rate-table th {
  background: #f3f8f5;
  color: var(--ink);
  font-weight: 600;
}
.tax-rate-table tr:hover { background: #f7fbf8; }
.tax-rate-cell {
  color: var(--brand);
  font-weight: 600;
}
@media (max-width: 900px) {
  .tax-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tax-main-value { font-size: 26px; }
}
@media (max-width: 560px) {
  .tax-result-grid { grid-template-columns: 1fr; }
}

/* 客户管理 / 合同管理 */
.crm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.crm-toolbar h1 { margin: 0; font-size: 22px; }
.crm-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.crm-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.crm-tab {
  border: none;
  background: transparent;
  padding: 10px 18px;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.crm-tab.active {
  color: var(--brand);
  font-weight: 600;
  border-bottom-color: var(--brand);
}
.crm-tab-pane[hidden] { display: none !important; }
.crm-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: inherit; /* 与选择框内文字同字号 */
  font-weight: inherit;
  color: var(--ink);
  cursor: pointer;
}
.req { color: var(--danger); }
.crm-readonly {
  padding: 8px 10px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
}
.crm-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.crm-entry {
  display: block;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f5faf7);
  color: inherit;
  text-decoration: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.crm-entry:hover {
  border-color: #8fbfa6;
  box-shadow: 0 8px 20px rgba(31, 107, 74, 0.08);
}
.crm-entry h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--brand);
}
.crm-entry p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.crm-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}
.crm-inline input { flex: 1; }
.inline-form { display: inline; margin: 0; }
.text-danger { color: #c0392b; }
.text-success { color: #1f6b4a; }
.text-warning { color: #b7791f; }
.text-info { color: #2563eb; }
.crm-notice {
  margin-top: 8px;
  padding: 10px 12px;
  background: #eef6ff;
  border: 1px solid #b8d4f0;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
}
.payment-summary { margin-bottom: 12px; }
.paid-period-table .paid-cell { background: #d4edda; text-align: center; }
.row-current-payment { background: #fff8e1; }
.invoice-list-box { margin: 12px 0; }
.invoice-summary-line { margin: 8px 0 12px; }
.over-under-info { margin-top: 6px; font-size: 14px; }
.balance-block { margin-top: 16px; }
.percentage-cell { cursor: text; min-width: 80px; }
.installment-total-row { background: #eef6ff; }
.placeholder-list code { background: #f4f4f4; padding: 2px 6px; border-radius: 4px; }
.about-center { max-width: 720px; margin: 0 auto; }
.about-version { font-size: 18px; color: var(--muted); }
.about-copy { margin-top: 24px; text-align: center; }
@media (max-width: 900px) {
  .crm-entry-grid { grid-template-columns: 1fr; }
}
