* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { font-family: "Microsoft YaHei", Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.query-page { min-height: 100vh; background: #071c42 url('/assets/bj.jpg') center center / 100% 100% no-repeat fixed; }
.query-shell { padding-top: calc(8vw + 70px); padding-bottom: 48px; }
.query-card { width: 40%; max-width: 560px; margin: 0 auto; padding: 50px; border-radius: 20px; background: #fff; box-shadow: 0 5px 10px rgb(0 0 0 / 50%); }
.brand { display: block; width: 100%; height: auto; margin-bottom: 20px; }
.query-card h1 { margin: 0 0 20px 15px; color: #7d7d7d; font-size: 18px; font-weight: 400; line-height: 24px; }
.query-card input { display: block; width: 100%; height: 34px; padding: 8px 15px; margin-bottom: 10px; border: 1px solid #7d7d7d; border-radius: 25px; outline: none; background: #fff; color: #111; font: 14px Arial, sans-serif; }
.query-card input:focus { border-color: #00479d; }
.query-card input::placeholder { color: #777; }
.query-button, .result-button { display: block; width: 100%; border: 0; border-radius: 25px; color: #fff; text-align: center; text-decoration: none; font-size: 16px; line-height: 21px; }
.query-button { min-height: 47px; padding: 13px 0; margin-top: 25px; background: #ca1622; }
.query-button:hover, .query-button:focus-visible { background: #111a48; }
.query-button:disabled { opacity: .6; cursor: wait; }
.result-button { min-height: 47px; padding: 13px 0; margin-top: 25px; background: #00479d; }
.result-button:hover, .result-button:focus-visible { background: #07346e; }
.message { margin: 18px 0 0; color: #b01c28; font-size: 14px; line-height: 1.5; }
@media (max-width: 1080px) { .query-card { width: 70%; } }
@media (max-width: 991px) { .query-card { width: 85%; } }
@media (max-width: 667px) {
  .query-card { width: 85%; padding: 44px 38px 44px 50px; }
  .query-card h1 { margin-left: 15px; }
  .query-card input { height: 42px; padding: 12px; }
  .query-button { min-height: 45px; padding: 12px 0; }
}
@media (max-width: 375px) { .query-card { width: 90%; padding: 30px; } }

.viewer-page { height: 100vh; display: flex; flex-direction: column; background: #eef1f4; color: #262e38; }
.viewer-header { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; background: #fff; border-bottom: 1px solid #dfe3e8; }
.viewer-header strong { font-size: 16px; }
.viewer-header a { color: #00479d; font-size: 14px; }
.viewer-main { flex: 1; min-height: 0; }
.viewer-main iframe { display: block; width: 100%; height: 100%; border: 0; }
.viewer-empty { margin: 15vh 20px 0; text-align: center; color: #69717c; }

.admin-page { min-height: 100vh; background: #f7f9f9; color: #24343a; font-size: 14px; }
.admin-page button, .admin-page input { font-family: inherit; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 17px; border-radius: 4px; font-size: 14px; white-space: nowrap; }
.primary-button { border: 1px solid #117b70; background: #117b70; color: #fff; }
.primary-button:hover { background: #09695f; }
.secondary-button { border: 1px solid #cbd5d5; background: #fff; color: #34454a; }
.secondary-button:hover { background: #f1f5f5; }
.admin-page button:disabled { opacity: .55; cursor: wait; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(380px, 100%); padding: 32px; background: #fff; border: 1px solid #e0e6e5; border-radius: 6px; box-shadow: 0 12px 35px rgb(21 43 46 / 8%); }
.login-mark, .sidebar-mark { display: inline-grid; place-items: center; background: #117b70; color: #fff; font-weight: 700; }
.login-mark { width: 38px; height: 38px; border-radius: 4px; }
.login-panel h1 { margin: 20px 0 30px; font-size: 21px; }
.login-panel label, .record-dialog label, .settings-form label { display: block; margin-bottom: 8px; color: #425359; font-size: 13px; }
.login-panel input, .record-dialog input, .settings-form input, .password-form input, .search-field input { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #cbd5d5; border-radius: 4px; outline: none; background: #fff; color: #24343a; }
.login-panel input:focus, .record-dialog input:focus, .settings-form input:focus, .password-form input:focus, .search-field input:focus { border-color: #117b70; box-shadow: 0 0 0 2px rgb(17 123 112 / 12%); }
.login-panel input { margin-bottom: 14px; }
.login-panel .primary-button { width: 100%; margin-top: 18px; }
.form-error { margin: 14px 0 0; color: #b0313a; }
.admin-layout { min-height: 100vh; display: flex; }
.admin-sidebar { width: 232px; flex: none; display: flex; flex-direction: column; background: #21363a; color: #d9e5e4; }
.sidebar-brand { min-height: 65px; display: flex; align-items: center; gap: 11px; padding: 0 21px; border-bottom: 1px solid rgb(255 255 255 / 9%); color: #fff; font-size: 16px; font-weight: 600; white-space: nowrap; }
.sidebar-mark { width: 29px; height: 29px; flex: none; border-radius: 3px; font-size: 11px; }
.sidebar-nav { display: grid; gap: 3px; padding: 21px 10px; }
.sidebar-nav button { min-height: 42px; padding: 0 15px; border: 0; border-radius: 4px; background: transparent; color: #c5d5d3; text-align: left; }
.sidebar-nav button:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.sidebar-nav button.active { background: #117b70; color: #fff; font-weight: 600; }
.sidebar-bottom { display: grid; gap: 5px; margin-top: auto; padding: 16px 20px 24px; border-top: 1px solid rgb(255 255 255 / 9%); }
.sidebar-bottom a, .sidebar-bottom button { padding: 7px 0; border: 0; background: transparent; color: #c5d5d3; text-align: left; text-decoration: none; font-size: 13px; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: #fff; }
.admin-workspace { min-width: 0; flex: 1; }
.workspace-bar { height: 65px; display: flex; align-items: center; justify-content: space-between; padding: 0 35px; background: #fff; border-bottom: 1px solid #e5eaea; color: #697a7d; font-size: 13px; }
.workspace-user { color: #425359; }
.workspace-main { max-width: 1500px; padding: 33px 35px 80px; margin: 0 auto; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-kicker { margin: 0 0 7px; color: #7b8a8c; font-size: 12px; }
.page-heading h1 { margin: 0; font-size: 23px; font-weight: 600; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); padding: 23px 0; border-top: 1px solid #dfe6e5; border-bottom: 1px solid #dfe6e5; background: #fff; }
.stats-row > div { display: grid; gap: 9px; padding: 0 26px; border-right: 1px solid #e5eaea; }
.stats-row > div:last-child { border-right: 0; }
.stats-row span { color: #738385; font-size: 13px; }
.stats-row strong { font-size: 28px; font-weight: 600; line-height: 1; }
.subheading { display: flex; align-items: center; justify-content: space-between; margin: 36px 0 14px; }
.subheading h2, .settings-group h2 { margin: 0; font-size: 16px; font-weight: 600; }
.text-button { border: 0; background: transparent; color: #117b70; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.search-field { display: block; width: min(360px, 100%); }
.search-field input { min-height: 38px; }
.list-count { color: #738385; white-space: nowrap; }
.table-shell { width: 100%; overflow-x: auto; border: 1px solid #e0e7e6; background: #fff; }
.table-shell table { width: 100%; border-collapse: collapse; text-align: left; }
.table-shell th { padding: 13px 16px; border-bottom: 1px solid #e4eaea; background: #fafcfc; color: #687a7c; font-size: 12px; font-weight: 500; white-space: nowrap; }
.table-shell td { padding: 15px 16px; border-bottom: 1px solid #edf0f0; line-height: 1.5; overflow-wrap: anywhere; }
.table-shell tr:last-child td { border-bottom: 0; }
.record-table td:nth-child(2) { min-width: 190px; }
.record-number { color: #24343a; font-weight: 600; white-space: nowrap; }
.status-ready { color: #117b70; white-space: nowrap; }
.status-pending { color: #a87520; white-space: nowrap; }
.row-actions { min-width: 230px; white-space: normal; }
.row-actions button, .row-actions a { display: inline-block; padding: 3px 5px; margin: 0 9px 2px 0; border: 0; background: transparent; color: #117b70; text-decoration: none; font-size: 13px; white-space: nowrap; }
.row-actions button:hover, .row-actions a:hover { text-decoration: underline; }
.row-actions .danger-action { color: #b0313a; }
.empty-state { padding: 42px 16px !important; color: #849194; text-align: center; }
.settings-group { max-width: 650px; padding: 27px 0 32px; border-top: 1px solid #dfe6e5; }
.settings-group h2 { margin-bottom: 20px; }
.settings-form { max-width: 570px; }
.password-form { display: grid; max-width: 420px; }
.password-form label { margin-bottom: 8px; color: #425359; font-size: 13px; }
.password-form input { margin-bottom: 16px; }
.password-form button { justify-self: start; }
.settings-input-row { display: flex; gap: 10px; }
.settings-input-row input { flex: 1; min-width: 0; }
.logo-preview { width: min(480px, 100%); min-height: 116px; display: flex; align-items: center; justify-content: center; padding: 18px; border: 1px solid #e0e7e6; background: #fff; }
.logo-preview img { max-width: 100%; max-height: 110px; object-fit: contain; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.input-note { display: block; margin-top: 10px; color: #839194; font-size: 12px; }
.record-dialog { width: min(470px, calc(100% - 24px)); padding: 26px; border: 1px solid #dce4e3; border-radius: 6px; box-shadow: 0 20px 60px rgb(20 38 41 / 20%); color: #24343a; }
.record-dialog::backdrop { background: rgb(14 30 34 / 45%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.dialog-heading h2 { margin: 0; font-size: 18px; }
.icon-button { width: 30px; height: 30px; border: 0; background: transparent; color: #758487; font-size: 25px; line-height: 1; }
.record-dialog input { margin-bottom: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.admin-toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(400px, calc(100vw - 48px)); padding: 12px 17px; border-left: 3px solid #117b70; background: #fff; box-shadow: 0 8px 28px rgb(20 38 41 / 16%); color: #26413d; }
.admin-toast.error { border-color: #b0313a; color: #b0313a; }
@media (max-width: 760px) {
  .admin-layout { display: block; }
  .admin-sidebar { width: 100%; }
  .sidebar-brand { min-height: 54px; }
  .sidebar-nav { display: flex; gap: 4px; padding: 8px 10px; overflow-x: auto; }
  .sidebar-nav button { min-height: 36px; padding: 0 13px; white-space: nowrap; }
  .sidebar-bottom { display: flex; gap: 18px; margin-top: 0; padding: 3px 21px 10px; border-top: 0; }
  .workspace-bar { height: 45px; padding: 0 18px; }
  .workspace-main { padding: 26px 16px 65px; }
  .page-heading h1 { font-size: 21px; }
  .stats-row > div { padding: 0 14px; }
  .stats-row strong { font-size: 24px; }
  .record-table thead { display: none; }
  .record-table tbody tr { display: block; padding: 12px 16px; border-bottom: 1px solid #e4eaea; }
  .record-table tbody tr:last-child { border-bottom: 0; }
  .record-table td { display: block; padding: 3px 0; border: 0; }
  .record-table td:nth-child(2) { min-width: 0; }
  .record-table td:nth-child(4) { color: #829092; font-size: 12px; }
  .record-table td:nth-child(4)::before { content: '更新 '; }
  .record-table .row-actions { min-width: 0; padding-top: 8px; }
}
@media (max-width: 430px) {
  .page-heading .primary-button { padding: 0 11px; }
  .stats-row span { font-size: 11px; }
  .stats-row > div { padding: 0 9px; }
  .settings-input-row { display: grid; }
  .settings-input-row .primary-button { justify-self: start; }
}
