:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172033; background: #f4f6f9; }
* { box-sizing: border-box; }
body { margin: 0; }
.page { width: min(1180px, calc(100% - 32px)); margin: 24px auto 48px; }
header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
h1 { margin: 0; font-size: 26px; } h2 { margin: 0 0 15px; font-size: 17px; }
.card { background: white; border: 1px solid #e1e6ef; border-radius: 10px; padding: 18px; margin: 14px 0; box-shadow: 0 2px 8px #17203308; }
.status-grid, .progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.status-grid strong, .progress-grid strong { display: block; margin-top: 7px; font-size: 16px; }
.status-warning { color: #a16207; }
.status-critical { color: #b42318; }
.label, .muted { color: #6e788b; font-size: 13px; }
.section-title, .toolbar, .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-title h2 { margin: 0; }
.action-feedback { flex-basis: 100%; min-height: 18px; }
.action-feedback.success { color: #18794e; }
.action-feedback.error { color: #b42318; }
.section-title { justify-content: space-between; margin-bottom: 16px; } .toolbar { margin-bottom: 14px; }

/* 实时进度网格：加宽列避免长标签换行，指标值统一贴底对齐 */
.progress-grid { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 20px 16px; }
.progress-grid > div { display: flex; flex-direction: column; justify-content: space-between;
                       min-height: 44px; font-size: 13px; color: #6e788b; line-height: 1.45; }
.progress-grid strong { margin-top: 8px; font-size: 16px; color: #172033; }
#match-summary:not(:empty) { margin-top: 16px; padding-top: 14px; border-top: 1px solid #eef1f6; }

/* 采集方式卡片右上角的文档入口，用提示色做视觉区分 */
.doc-links { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px 8px 11px; border-radius: 8px;
            border: 1px solid; border-left-width: 4px; font-size: 13.5px; font-weight: 700;
            text-decoration: none; letter-spacing: .01em;
            transition: background .16s, border-color .16s, box-shadow .16s, transform .16s; }
.doc-link-icon { font-size: 14px; line-height: 1; }
.doc-link-hint { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
                 background: #fff; opacity: .9; }
.doc-link:hover { transform: translateY(-1px); }
.doc-link:active { transform: translateY(0); }
.doc-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* 架构图入口：蓝紫 */
.doc-link-arch { color: #3730a3; border-color: #a5b4fc; background: #e0e7ff; }
.doc-link-arch .doc-link-hint { color: #4338ca; }
.doc-link-arch:hover { border-color: #6366f1; background: #c7d2fe; box-shadow: 0 5px 16px #4f46e545; }

/* 数据库结构图入口：青绿 */
.doc-link-db { color: #115e59; border-color: #5eead4; background: #ccfbf1; }
.doc-link-db .doc-link-hint { color: #0f766e; }
.doc-link-db:hover { border-color: #14b8a6; background: #99f6e4; box-shadow: 0 5px 16px #14b8a645; }

@media (prefers-reduced-motion: reduce) { .doc-link { transition: none; } .doc-link:hover { transform: none; } }
@media (max-width: 640px) { .doc-link-hint { display: none; } }

/* 悬浮提示气泡：纯 CSS，内容取自 data-tip，避免原生 title 的延迟与不可控样式 */
.doc-link[data-tip] { position: relative; }
.doc-link[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 10px); right: 0;
  z-index: 20; width: max-content; max-width: 340px; padding: 9px 12px; border-radius: 8px;
  background: #1f2937; color: #f9fafb; font-size: 12px; font-weight: 400; line-height: 1.65;
  text-align: left; white-space: normal; box-shadow: 0 8px 24px #17203340;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .16s, transform .16s, visibility .16s; pointer-events: none; }
.doc-link[data-tip]::before { content: ""; position: absolute; top: calc(100% + 4px); right: 18px;
  z-index: 21; border: 6px solid transparent; border-bottom-color: #1f2937;
  opacity: 0; visibility: hidden; transition: opacity .16s, visibility .16s; pointer-events: none; }
.doc-link[data-tip]:hover::after, .doc-link[data-tip]:focus-visible::after { opacity: 1; visibility: visible; transform: translateY(0); }
.doc-link[data-tip]:hover::before, .doc-link[data-tip]:focus-visible::before { opacity: 1; visibility: visible; }

@media (max-width: 640px) {
  .doc-link[data-tip]::after { right: auto; left: 0; max-width: 78vw; }
  .doc-link[data-tip]::before { right: auto; left: 18px; }
}
@media (prefers-reduced-motion: reduce) { .doc-link[data-tip]::after, .doc-link[data-tip]::before { transition: none; } }
button, .button { border: 1px solid #cbd3df; border-radius: 6px; padding: 8px 12px; background: #fff; color: #172033; cursor: pointer; text-decoration: none; font-size: 14px; }
button:hover, .button:hover { background: #f1f5fa; } button.primary { color: #fff; border-color: #2563eb; background: #2563eb; } button.danger { color: #a11; }
.field-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 18px; max-height: 300px; overflow: auto; padding: 4px; }
.field-item { display: flex; gap: 8px; align-items: center; padding: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; font-size: 13px; color: #556176; } input, select { padding: 9px; border: 1px solid #cbd3df; border-radius: 6px; background: #fff; color: #172033; }
input[type="radio"], input[type="checkbox"] { padding: 0; }
section.card > label:not(.field-item) { display: inline-flex; align-items: center; gap: 6px; }
[hidden] { display: none !important; }
#journal-lines { width: 100%; padding: 10px; }
.journal-preview-table { max-height: 340px; overflow: auto; margin-top: 12px; }
.journal-preview-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.journal-preview-table th, .journal-preview-table td { text-align: left; padding: 8px; border-bottom: 1px solid #e1e6ef; }
.journal-preview-table th { position: sticky; top: 0; background: #f4f6f9; white-space: nowrap; }
button:disabled { opacity: .5; cursor: wait; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef2f7; }
.login-card { width: min(420px, 100%); padding: 30px; border: 1px solid #dce3ed; border-radius: 14px; background: #fff; box-shadow: 0 18px 50px #17203318; }
.login-card h1 { margin-bottom: 10px; }
.login-eyebrow { margin: 0 0 12px; color: #2563eb; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.login-form { display: grid; gap: 16px; margin-top: 22px; }
.login-form input { width: 100%; font-size: 16px; }
.login-form button { width: 100%; }
.login-error { padding: 10px 12px; border-radius: 6px; color: #991b1b; background: #fef2f2; font-size: 14px; }
@media (max-width: 640px) { header { display: block; } h1 { margin-bottom: 6px; } .header-actions { justify-content: space-between; } }
