* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: #f4f6f9; color: #222; }
.view-as-bar { position: sticky; top: 0; z-index: 1300; background: #7c3aed; color: #fff; padding: 8px 16px; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.view-as-bar .view-as-exit { color: #fff; text-decoration: underline; font-weight: 600; }
a { color: #2563eb; text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.side { width: 210px; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; }
.menu-toggle { display: none; }
.brand { padding: 20px 18px; font-size: 18px; font-weight: bold; color: #fff; border-bottom: 1px solid #334155; flex-shrink: 0; }
.brand[data-editable="1"] { cursor: text; }
.brand[data-editable="1"]:hover { background: #334155; }
.brand-edit { width: 100%; padding: 3px 6px; border: 1px solid #94a3b8; border-radius: 4px; background: #0f172a; color: #fff; font: inherit; outline: none; }
.side nav { padding: 12px 0; flex: 1; min-height: 0; overflow-y: auto; }
.side nav a { display: block; padding: 12px 18px; color: #cbd5e1; }
.side nav a:hover { background: #334155; color: #fff; }
.side nav a.active { background: #2563eb; color: #fff; }
.side-bottom { padding: 14px 18px; border-top: 1px solid #334155; font-size: 13px; margin-top: auto; flex-shrink: 0; }
.side-bottom .me { color: #fff; margin-bottom: 6px; }
.main { flex: 1; padding: 24px; overflow-x: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h2, .main h2 { margin: 0 0 16px; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions .btn, .actions .inline-form button, .actions .inline button { height: 34px; display: inline-flex; align-items: center; padding: 0 14px; line-height: 1; }
.actions .inline-form { display: flex; align-items: center; gap: 8px; }
.actions .inline-form input[type="file"] { height: 34px; padding: 6px 8px; }
.btn { display: inline-block; padding: 8px 14px; background: #e2e8f0; color: #1e293b; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn:hover { opacity: .9; }
.btn.primary { background: #2563eb; color: #fff; }
.btn.danger { background: #fee2e2; color: #b91c1c; }
.btn.small { padding: 4px 8px; font-size: 12px; }
.btn.block { width: 100%; }
.search-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.search-bar input, .search-bar select { flex: 1; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; }
.count { color: #64748b; font-size: 13px; margin: 4px 0 10px; }
.table-wrap { background: #fff; border-radius: 10px; overflow: auto; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #eef1f5; text-align: left; vertical-align: top; }
.th-export { text-align: right; white-space: nowrap; }
.td-export { width: 1%; }
th { background: #f8fafc; color: #475569; font-weight: 600; white-space: nowrap; }
td.wrap { max-width: 260px; }
td.nowrap { white-space: nowrap; }
td.ops { white-space: nowrap; }
td.ops .inline { display: inline-block; margin-right: 4px; }
.inline { display: inline; }
.inline select { padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 6px; }
.empty { text-align: center; color: #94a3b8; padding: 30px; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.badge.won { background: #dcfce7; color: #15803d; }
.badge.follow { background: #dbeafe; color: #1d4ed8; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.flash.ok { background: #dcfce7; color: #15803d; }
.flash.error { background: #fee2e2; color: #b91c1c; }
.form { background: #fff; border-radius: 10px; padding: 24px 26px; box-shadow: 0 1px 3px rgba(0,0,0,.08); max-width: 460px; margin: 0 auto; }
.form label { display: block; margin-bottom: 14px; font-size: 14px; color: #334155; }
.form input, .form select, .form textarea { width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-family: inherit; font-size: 14px; }
.form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form.detail-form { max-width: 760px; }
.detail-basic { margin-bottom: 16px; border-bottom: 1px solid #eef1f5; }
.detail-row { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 58px; color: #64748b; flex-shrink: 0; }
.detail-value { color: #1e293b; font-weight: 600; word-break: break-all; }
.call-records { margin: 16px 0; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.call-records summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: #334155; user-select: none; }
.call-records summary:hover { background: #eef2f7; }
.record-count { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 12px; font-weight: normal; }
.call-records[open] summary { border-bottom: 1px solid #e2e8f0; }
.call-record-list { padding: 6px 14px 12px; max-height: 360px; overflow-y: auto; }
.call-record { padding: 10px 0; border-bottom: 1px dashed #dbe3ee; }
.call-record:last-child { border-bottom: none; }
.call-record-main { color: #1e293b; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.call-record-meta { margin-top: 4px; color: #64748b; font-size: 12px; }
.badge.wechat { background: #dcfce7; color: #15803d; margin-left: 6px; font-size: 11px; padding: 1px 7px; }
.card { background: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card h3 { margin: 0 0 10px; }
.guide-card details { margin: 12px 0; border-bottom: 1px solid #eef1f5; padding-bottom: 8px; }
.guide-card details:last-child { border-bottom: none; }
.guide-card summary { cursor: pointer; font-weight: 600; color: #1e293b; font-size: 15px; }
.guide-card ul { margin: 8px 0 0 18px; color: #475569; line-height: 1.8; }
.guide-card li ul { margin-top: 4px; }
.card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head-row h3 { margin: 0; }
.sheet-actions { justify-content: center; margin: 8px 0 12px; }
.perm-mark { font-weight: 700; }
.perm-yes { color: #16a34a; }
.perm-no { color: #e11d48; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input, .inline-form select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; }
.hint { color: #64748b; font-size: 13px; }
.hint-list { color: #475569; line-height: 1.9; }
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #1e293b; }
.login-box { width: 360px; background: #fff; border-radius: 12px; padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.login-box h1 { margin: 0 0 4px; font-size: 22px; text-align: center; }
.login-box .sub { text-align: center; color: #64748b; margin: 0 0 20px; }
.login-box label { display: block; margin-bottom: 12px; font-size: 14px; color: #334155; }
.login-box input { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; }
.import-table input, .import-table select, .import-table textarea { width: 100%; min-width: 110px; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 6px; font-family: inherit; font-size: 13px; }
@media (max-width: 768px) {
  .menu-toggle { display: flex; align-items: center; justify-content: center; position: fixed; top: 8px; left: 8px; z-index: 1200; width: 40px; height: 40px; border: none; border-radius: 8px; background: #1e293b; color: #fff; font-size: 20px; cursor: pointer; }
  .layout { display: block; padding-top: 56px; }
  .side { position: fixed; left: -240px; top: 0; bottom: 0; width: 220px; height: auto; z-index: 1100; transition: left .2s ease; box-shadow: 2px 0 12px rgba(0,0,0,.3); }
  .side.open { left: 0; }
  .main { padding: 12px; overflow-x: hidden; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .actions { flex-wrap: wrap; }
  .search-bar { flex-direction: column; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input, .inline-form select, .inline-form textarea { width: 100%; }
  .form { padding: 16px; }
  .form .grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .login-box { width: 90%; max-width: 360px; }
}
/* v2 新增 */
.checks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #334155; }
.check input { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 12px; }
.scroll { max-height: 440px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; }
.checks.scroll .check { padding: 2px 5px; border-radius: 4px; }
.checks.scroll .check:hover { background: #f1f5f9; }
.check.checked { background: #eff6ff; }
.select-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.role-tag { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 11px; }
.excel th { border: 1px solid #cbd5e1; background: #eef2f7; white-space: normal; }
.excel td { border: 1px solid #e2e8f0; }
details summary { cursor: pointer; color: #2563eb; display: inline-block; margin-right: 6px; }
details { display: inline-block; }
.hint { color: #64748b; font-size: 13px; }
h4 { margin: 8px 0 6px; font-size: 14px; color: #334155; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.pager { display:flex; align-items:center; gap:10px; margin-top:14px; }

.excel th, .excel td { white-space: nowrap; }
.excel { width: max-content; min-width: 100%; }
.sheet-wrap { overflow-x: auto; overflow-y: auto; max-height: 80vh; }
.name-cell { max-width: 140px; word-break: break-all; }

/* 居中彩色提示 + 弹窗 */
.toast-wrap { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 1000; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { padding: 14px 26px; border-radius: 10px; color: #fff; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: 80vw; }
.toast.ok { background: #16a34a; }
.toast.error { background: #dc2626; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 1001; }
.modal-box { background: #fff; border-radius: 12px; padding: 26px 30px; min-width: 300px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.modal-text { font-size: 16px; margin: 0 0 22px; color: #1e293b; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.badge.doing { background: #e2e8f0; color: #475569; }
.status-pill { border: none; cursor: pointer; font-family: inherit; }
.op-toggle { display: inline-block; width: 72px; min-width: 72px; max-width: 72px; padding-left: 2px; padding-right: 2px; text-align: center; white-space: nowrap; }
.back-btn { background: #16a34a; color: #fff; padding: 10px 20px; font-size: 15px; }
.back-btn:hover { opacity: .9; }
.remote-head { align-items: center; }
.remote-head-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.remote-head-center h2 { margin: 0; }
.remote-head-spacer { width: 96px; }
.share-bar { display: flex; gap: 8px; align-items: center; max-width: 620px; width: 100%; }
.share-bar input { flex: 1; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.share-status { font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.share-status.filled { background: #dcfce7; color: #15803d; }
.share-status.opened { background: #fef9c3; color: #a16207; }
.share-status.none { background: #e2e8f0; color: #64748b; }
.remote-filled { background: #16a34a; color: #fff; }
.status-pill:hover { opacity: .85; }
.remark-modal-box { width: 560px; max-width: calc(100vw - 32px); text-align: left; }
.export-modal-box { width: 380px; max-width: calc(100vw - 32px); text-align: left; }
.export-options { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 18px; }
.export-options .btn { text-align: center; }
.export-options .btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.export-scope { margin: 2px 0 18px; display: flex; flex-direction: column; gap: 8px; }
.export-scope-title { font-size: 13px; color: #64748b; }
.radio { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #334155; cursor: pointer; }
.radio input { margin: 0; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 18px; color: #1e293b; }
.modal-head .hint { margin: 4px 0 0; }
.modal-close { border: none; background: transparent; color: #64748b; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: #0f172a; }
.status-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.status-option { padding: 8px 16px; border: 1px solid #d1d5db; background: #f8fafc; color: #334155; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 14px; }
.status-option:hover { background: #eef2f7; }
.status-option.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.remark-field { display: block; color: #334155; font-size: 14px; }
.remark-field textarea { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; font-family: inherit; font-size: 14px; resize: vertical; }
.page-title { text-align: center; margin-bottom: 18px; }
.form .actions { justify-content: center; }
.btn.green { background: #16a34a; color: #fff; }
.checks-h { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 10px; overflow-x: scroll; max-width: 100%; padding: 6px 0 10px; align-items: center; }
.checks-h .check { flex: 0 0 auto; white-space: nowrap; }
.cols-panel { margin: 0 0 12px; }
.cols-panel summary { cursor: pointer; color: #2563eb; margin-bottom: 8px; }
.cols-form { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; }
.form label { text-align: center; }
.cols-scroll { display: flex; align-items: center; gap: 6px; }
.cols-scroll .checks-h { flex: 1; }
.arrow { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: 18px; line-height: 1; color: #334155; }
.arrow:hover { background: #eef2f7; }
.checks-h::-webkit-scrollbar { height: 8px; }
.checks-h::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }
.checks-h::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.cols-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.row-done td { background: #e8f7ea !important; }
.row-done:hover td { background: #e2f4e5 !important; }
.btn.done { background: #16a34a; color: #fff; }

.remote-fields input { width: 100%; min-width: 320px; }
.remote-field-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.remote-row-remove:disabled { opacity: .38; cursor: not-allowed; }
.remote-file-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.remote-file-head h3 { margin-top: 0; }
.remote-file-head .hint { margin: 4px 0 0; }
.remote-file-list { display: grid; gap: 8px; margin-top: 14px; }
.remote-file-item { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.remote-file-type { display: inline-grid; place-items: center; min-height: 34px; border-radius: 8px; color: #1e5ba9; background: #eaf2ff; font-size: 11px; font-weight: 700; }
.remote-file-main { min-width: 0; }
.remote-file-main b { display: block; overflow: hidden; color: #1e293b; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.remote-file-main small { display: block; margin-top: 3px; color: #64748b; font-size: 12px; }
.remote-file-actions { display: flex; gap: 6px; white-space: nowrap; }
.remote-file-empty { margin-top: 12px; }
.data-file-table table { min-width: 1180px; }
.data-file-ops { min-width: 290px; }
.data-assign-form { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.data-assign-form select { min-width: 150px; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.data-text-preview { max-height: 72vh; overflow: auto; margin: 0; padding: 16px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fbfdff; color: #1e293b; font: 13px/1.7 Consolas, "Microsoft YaHei", monospace; white-space: pre-wrap; word-break: break-word; }
.data-preview-table { max-height: 76vh; overflow: auto; }
.data-preview-table th, .data-preview-table td { white-space: pre-wrap; min-width: 90px; }
@media (max-width: 720px) {
  .remote-file-head { flex-direction: column; }
  .remote-file-item { grid-template-columns: 54px minmax(0, 1fr); }
  .remote-file-actions { grid-column: 2; }
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: #64748b; }

tr.role-admin td { background: #fef2f2; }
tr.role-gm td { background: #eef4ff; }
tr.role-supervisor td { background: #fff7ed; }
tr.role-user td { background: #f8fafc; }
.sheet-cell { position: relative; }
.col-resizer { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 2; background: transparent; }
.col-resizer:hover { background: #cbd5e1; }

/* ── 显示区域主题：默认暖黄，导航保持原深色 ───────────────── */
html[data-theme="warm"] body {
  background:
    radial-gradient(circle at 8% 0%, rgba(236,189,92,.18), transparent 24rem),
    radial-gradient(circle at 96% 10%, rgba(219,170,72,.1), transparent 26rem),
    linear-gradient(145deg, #fbf6e9 0%, #f5ebd0 52%, #f0e2be 100%) !important;
  color: #3c3323;
}
html[data-theme="warm"] .main {
  background: transparent;
}
html[data-theme="warm"] .table-wrap,
html[data-theme="warm"] .form,
html[data-theme="warm"] .card,
html[data-theme="warm"] .modal-box,
html[data-theme="warm"] .call-records,
html[data-theme="warm"] .cols-form {
  background: #fffdf8 !important;
  border-color: #eadcbe !important;
  box-shadow: 0 10px 28px rgba(105,76,26,.07) !important;
}
html[data-theme="warm"] th {
  background: #f8efda !important;
  color: #725a34 !important;
  border-color: #eadcbe !important;
}
html[data-theme="warm"] td {
  border-color: #eee3cb !important;
}
html[data-theme="warm"] .table-wrap td {
  background-color: #fffdf8;
}
html[data-theme="warm"] .table-wrap tr:nth-child(even) td {
  background-color: #fdf8ed;
}
html[data-theme="warm"] .table-wrap tr:hover td {
  background-color: #f8edcf !important;
}
html[data-theme="warm"] .page-head h2,
html[data-theme="warm"] .main h2,
html[data-theme="warm"] .main h3,
html[data-theme="warm"] .detail-value {
  color: #4b3a21;
}
html[data-theme="warm"] .count,
html[data-theme="warm"] .detail-label,
html[data-theme="warm"] .hint {
  color: #8f7954 !important;
}
html[data-theme="warm"] .btn {
  background: #f3e8ce;
  color: #5e4725;
}
html[data-theme="warm"] .btn.primary {
  background: #b97921;
  color: #fff;
}
html[data-theme="warm"] .btn.danger {
  background: #fee9e4;
  color: #b34535;
}
html[data-theme="warm"] .form input,
html[data-theme="warm"] .form select,
html[data-theme="warm"] .form textarea,
html[data-theme="warm"] .search-bar input,
html[data-theme="warm"] .search-bar select,
html[data-theme="warm"] .inline select {
  background: #fffdf8;
  border-color: #ddcba3;
}
html[data-theme="warm"] .side-bottom .me {
  color: #ffe3a0;
  cursor: pointer;
  user-select: none;
}
html[data-theme="warm"] .side-bottom .me:hover {
  color: #fff3cb;
  text-shadow: 0 0 12px rgba(255,210,102,.28);
}
html[data-theme="pearl"] body {
  background: #f4f6f9;
}
