* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif; background: #f4f7fb; color: #26364b; }
button, input, textarea, select { font: inherit; }
a { color: #246bb8; }
h1 { margin: 0; font-size: 26px; }
.muted { color: #78889b; font-size: 13px; }
.small { font-size: 12px; }
.primary, .outline { border-radius: 9px; padding: 10px 16px; cursor: pointer; font-size: 13px; font-weight: 700; white-space: nowrap; }
.primary { background: #3275c4; color: #fff; border: 1px solid #3275c4; }
.primary:hover { background: #2466b4; }
.outline { background: #fff; color: #35699f; border: 1px solid #cbd9eb; }
.outline:hover { background: #edf5ff; }
.install-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; }
.install-card { width: min(580px, 100%); border: 1px solid #e1e8f1; border-radius: 16px; background: #fff; padding: clamp(20px, 3.2vw, 36px); box-shadow: 0 20px 55px rgba(28, 55, 89, .08); }
.install-card h1 { margin-bottom: 8px; }
.install-card > .muted { line-height: 1.7; margin-bottom: 22px; }
.install-card label, .form-grid label { display: block; color: #4a5d76; font-size: 13px; font-weight: 650; }
.install-card input:not([type=checkbox]), .form-grid input, .form-grid textarea, .form-grid select { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; min-height: 40px; border: 1px solid #d5deea; border-radius: 8px; color: #26364b; background: #fff; font-weight: 400; outline-color: #3685d2; }
.form-grid textarea { resize: vertical; line-height: 1.55; }
.install-card .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin-bottom: 18px; }
.install-card .wide, .form-grid .wide { grid-column: 1 / -1; }
.install-card .check { margin: 10px 0 20px; display: flex; align-items: center; gap: 9px; font-weight: 400; }
.install-card .primary { width: 100%; }
.login-card { width: min(420px, 100%); }
.login-card form label { margin: 16px 0; }
.alert { margin: 0 0 18px; border-radius: 9px; padding: 12px 15px; line-height: 1.55; font-size: 13px; }
.alert-error { color: #a63843; background: #fff0f2; border: 1px solid #f6d5dc; }
.alert-ok { color: #247a5b; background: #ecfaf3; border: 1px solid #c9efda; }
.admin-page { min-height: 100vh; display: grid; grid-template-columns: 215px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: #1c2f49; color: #fff; padding: 28px 14px; display: flex; flex-direction: column; }
.brand { padding: 5px 12px 28px; font-size: 19px; font-weight: 800; }
.brand span { display: block; margin-top: 5px; font-size: 11px; font-weight: 400; color: #9db4cf; }
.nav-item { display: block; padding: 12px 14px; border-radius: 9px; color: #c8d6e8; font-size: 14px; font-weight: 700; text-decoration: none; }
.nav-item.active, .nav-item:hover { background: #335574; color: #fff; }
.sidebar form { margin-top: auto; }
.logout { border: 0; background: transparent; color: #adbed2; cursor: pointer; padding: 12px 14px; }
.admin-main { min-width: 0; padding: 36px clamp(18px, 3vw, 42px) 65px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 24px; }
.admin-header p { margin: 8px 0 0; font-size: 13px; color: #7d8da2; }
.front-link { font-size: 13px; white-space: nowrap; text-decoration: none; }
.access-settings { position: relative; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(410px, 1.4fr); gap: 16px 28px; align-items: end; margin: 0 0 18px; padding: 18px 20px; border: 1px solid #dfe8f3; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(33, 64, 100, .04); }
.access-settings h2 { margin: 0 0 7px; font-size: 16px; }
.access-settings p { margin: 0; color: #78889b; font-size: 12px; line-height: 1.7; }
.access-on { color: #21835e; }
.access-off { color: #8b98a8; }
.access-password-form { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)) auto; gap: 10px; align-items: end; }
.access-password-form label { color: #4a5d76; font-size: 12px; font-weight: 650; }
.access-password-form input { display: block; width: 100%; min-height: 40px; margin-top: 6px; padding: 9px 11px; border: 1px solid #d5deea; border-radius: 8px; color: #26364b; outline-color: #3685d2; }
.access-clear-form { grid-column: 2; justify-self: end; margin-top: -4px; }
.front-access-page .primary:disabled { opacity: .55; cursor: not-allowed; }
.admin-panel { border: 1px solid #e0e8f2; border-radius: 14px; background: #fff; overflow: hidden; box-shadow: 0 12px 36px rgba(33, 64, 100, .055); }
.panel-toolbar { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-toolbar strong { display: block; font-size: 16px; margin-bottom: 4px; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-scroll { overflow-x: auto; scrollbar-color: #bbcbdc #f3f7fb; width: 100%; }
.admin-scroll.expanded { cursor: grab; }
.admin-scroll.is-dragging { cursor: grabbing; user-select: none; }
table { min-width: 1010px; width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 13px; }
.admin-scroll.expanded table { width: max-content; min-width: 100%; }
th, td { padding: 16px 15px; border-bottom: 1px solid #edf1f6; white-space: nowrap; vertical-align: middle; }
th { background: #eaf3fc; color: #465d7c; font-weight: 700; font-size: 12px; position: sticky; top: 0; z-index: 2; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fbff; }
.extra { display: none; }
.expanded .extra { display: table-cell; }
.date { font-weight: 700; color: #344d6d; }
.subline { display: block; font-weight: 400; color: #8592a5; font-size: 12px; margin-top: 5px; }
.id { color: #8090a2; font-variant-numeric: tabular-nums; }
.sample-badge { display: inline-block; margin-left: 6px; border-radius: 5px; padding: 2px 5px; color: #b46620; background: #fff1e0; font-size: 11px; font-weight: 600; }
.mechanism { min-width: 145px; max-width: 210px; white-space: pre-wrap; line-height: 1.55; }
.remark { min-width: 180px; max-width: 320px; white-space: pre-wrap; line-height: 1.55; }
.share-path { min-width: 180px; max-width: 320px; overflow-wrap: anywhere; line-height: 1.55; }
td.extra a { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.action { position: sticky; right: 0; z-index: 3; text-align: center; min-width: 145px; background: #f8fbff; box-shadow: -7px 0 14px rgba(52, 76, 108, .06); }
th.action { z-index: 4; background: #e2effb; }
tbody tr:hover .action { background: #f1f7ff; }
.text-button { border: 0; background: none; color: #216bb9; font-weight: 700; font-size: 13px; cursor: pointer; padding: 6px; }
.text-button.danger { color: #cc4d57; }
.text-button:hover { text-decoration: underline; }
.panel-footer { padding: 12px 20px; border-top: 1px solid #edf1f6; font-size: 12px; color: #8491a4; }
.empty { text-align: center; padding: 30px; color: #7e8da0; font-size: 14px; }
dialog { border: 0; border-radius: 16px; padding: 0; width: min(820px, 94vw); max-height: 88vh; color: #26364b; box-shadow: 0 25px 80px rgba(22, 43, 73, .25); }
dialog::backdrop { background: rgba(22, 41, 65, .55); }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 24px; background: #eef5fd; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.close-dialog { border: 0; background: transparent; color: #63768d; font-size: 26px; cursor: pointer; line-height: 1; }
.dialog-body { padding: 22px 24px; overflow-y: auto; max-height: calc(88vh - 140px); }
.dialog-actions { background: #fff; border-top: 1px solid #ecf0f5; justify-content: end; }
.dialog-actions .close-dialog { font-size: 13px; padding: 10px 16px; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.form-grid label em { color: #cb4956; font-style: normal; }
.anchor-field em { color: #cb4956; font-style: normal; }
.rich-field-title { display: block; color: #4a5d76; font-size: 13px; font-weight: 650; }
.format-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.format-command { min-width: 32px; min-height: 30px; padding: 3px 7px; border: 1px solid #cbd9eb; border-radius: 6px; background: #fff; color: #345a84; cursor: pointer; }
.format-command:hover { background: #edf5ff; }
.format-color-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #556d8a; }
.form-grid .format-color { display: inline-block; margin: 0; width: 38px; min-height: 30px; height: 30px; padding: 2px; border-radius: 6px; cursor: pointer; }
.format-hint { color: #8190a1; font-size: 12px; }
.format-editor { display: block; width: 100%; min-height: 90px; max-height: 220px; overflow-y: auto; padding: 10px 12px; margin-top: 8px; border: 1px solid #d5deea; border-radius: 8px; background: #fff; color: #26364b; font-size: 14px; font-weight: 400; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; outline-color: #3685d2; }
.format-editor:empty::before { content: attr(data-placeholder); color: #a0acba; pointer-events: none; }
.handcard-editor { min-height: 170px; max-height: 340px; }
.handcard-summary { color: #497496; }
.anchor-dialog { width: min(610px, 94vw); }
.anchor-list-dialog { width: min(760px, 94vw); }
.history-dialog { width: min(1080px, 96vw); }
.history-close-icon { border: 0; background: transparent; color: #63768d; font-size: 26px; line-height: 1; cursor: pointer; }
.history-note { margin: 0 0 10px; color: #667b93; font-size: 13px; }
.history-scroll { overflow: auto; max-height: min(55vh, 650px); }
.history-table { min-width: 760px; }
.history-table th, .history-table td { padding: 11px 12px; }
.history-table th { position: sticky; top: 0; z-index: 1; }
.history-table td { max-width: 270px; white-space: normal; overflow-wrap: anywhere; }
.history-actions { min-width: 110px; white-space: nowrap !important; }
.history-details { margin-top: 6px; font-size: 12px; }
.history-details summary { color: #246bb8; cursor: pointer; }
.history-details dl { display: grid; gap: 7px; margin: 9px 0 0; }
.history-details dl div { padding-bottom: 6px; border-bottom: 1px solid #edf1f6; }
.history-details dt { color: #78889b; }
.history-details dd { margin: 2px 0 0; color: #334760; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-empty { padding: 25px; color: #8190a3; text-align: center; }
.history-empty[hidden] { display: none; }
.anchor-field { min-width: 0; }
.anchor-combobox { position: relative; margin-top: 8px; }
.form-grid .anchor-combobox > input { margin: 0; padding-right: 46px; }
.anchor-combobox-toggle { position: absolute; top: 0; right: 0; bottom: 0; width: 43px; height: auto; padding: 0; border: 0; border-left: 1px solid #e0e6ee; border-radius: 0; background: transparent; color: #536c88; cursor: pointer; z-index: 2; }
.anchor-combobox-toggle::after { content: ""; position: absolute; left: 50%; top: 47%; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translate(-50%, -50%) rotate(45deg); transition: transform .16s ease; }
.anchor-combobox-toggle:hover, .anchor-combobox-toggle[aria-expanded="true"] { background: rgba(52, 124, 202, .07); color: #246bb8; }
.anchor-combobox-toggle[aria-expanded="true"]::after { top: 55%; transform: translate(-50%, -50%) rotate(225deg); }
.anchor-combobox-toggle:focus-visible { outline: 2px solid #3685d2; outline-offset: -3px; }
.anchor-source-select { display: none !important; }
.anchor-combobox-options { position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 20; max-height: 260px; overflow-y: auto; padding: 5px; border: 1px solid #ccd9e9; border-radius: 9px; background: #fff; box-shadow: 0 14px 35px rgba(34, 58, 91, .18); }
.anchor-combobox-options[hidden] { display: none; }
.anchor-combobox-option { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 0; border-radius: 7px; background: #fff; color: #30445d; text-align: left; cursor: pointer; }
.anchor-combobox-option:hover, .anchor-combobox-option:focus-visible, .anchor-combobox-option[aria-selected="true"] { background: #edf5ff; outline-color: #347cca; }
.anchor-combobox-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anchor-combobox-option small { flex: 0 0 auto; color: #8190a3; font-size: 12px; font-weight: 400; }
.anchor-combobox-empty { margin: 0; padding: 13px 10px; color: #8190a3; font-size: 13px; text-align: center; }
.anchor-picker-hint { display: block; margin-top: 6px; color: #8190a3; font-size: 12px; font-weight: 400; }
.anchor-list-search { display: block; margin-bottom: 14px; color: #4a5d76; font-size: 13px; font-weight: 650; }
.anchor-list-search input { display: block; width: 100%; margin-top: 7px; padding: 10px 12px; min-height: 40px; border: 1px solid #d5deea; border-radius: 8px; color: #26364b; background: #fff; font-weight: 400; outline-color: #3685d2; }
.anchor-message { min-height: 20px; margin: 0 0 10px; color: #ad4852; font-size: 13px; }
.anchor-message:empty { display: none; }
.anchor-list-scroll { overflow: auto; max-height: min(50vh, 520px); }
.anchor-table { min-width: 480px; width: 100%; }
.anchor-table th, .anchor-table td { padding: 12px 14px; }
.anchor-table th { position: static; }
.anchor-table td input { width: 100%; min-width: 100px; padding: 8px; border: 1px solid #d5deea; border-radius: 7px; }
.anchor-row-actions { min-width: 130px; white-space: nowrap; }
.anchor-empty { text-align: center; color: #8190a3; }
.anchor-pagination { justify-content: flex-end; flex-wrap: wrap; }
.anchor-pagination span { margin-right: auto; color: #667b93; font-size: 13px; }
.anchor-pagination button:disabled { opacity: .48; cursor: default; }
.copy-tip { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 9px 15px; border-radius: 9px; background: #263b59; color: #fff; font-size: 13px; z-index: 10; }
.copy-tip[hidden] { display: none; }
@media (max-width: 740px) {
  .admin-page { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 16px; flex-direction: row; align-items: center; gap: 10px; }
  .brand { padding: 0; font-size: 15px; white-space: nowrap; }
  .brand span { display: none; }
  .sidebar nav { flex: 1; overflow-x: auto; }
  .nav-item { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .logout { padding: 7px 4px; font-size: 12px; white-space: nowrap; }
  .admin-main { padding: 20px 4vw 45px; }
  .admin-header h1 { font-size: 21px; }
  .panel-toolbar { flex-wrap: wrap; padding: 15px; }
  .access-settings { grid-template-columns: 1fr; }
  .access-password-form { grid-template-columns: 1fr; }
  .access-clear-form { grid-column: 1; justify-self: start; margin-top: 0; }
  .install-card .form-grid, .form-grid { grid-template-columns: 1fr; }
}
