/* 智脑协同统一设计覆盖层
   由 index.html 在 style.css 之后加载。只收口尺寸、字号、间距与交互状态，
   不改业务结构；品牌红、金、青沿用出海龙视觉。 */
:root {
  --brand-red: #c9341b;
  --brand-red-dark: #a92b16;
  --brand-red-soft: #fff0e9;
  --brand-gold: #f2b544;
  --brand-gold-soft: #fff6df;
  --brand-teal: #16878b;
  --brand-teal-soft: #e8f7f4;
  --ink-strong: #263238;
  --ink: #405066;
  --ink-muted: #788497;
  --line: #e7e1db;
  --surface: #fff;
  --page: #faf8f5;
  --radius-card: 12px;
  --radius-control: 8px;
  --space-card: 20px;
  --control-height: 40px;
  --font-ui: "Microsoft YaHei", "微软雅黑", system-ui, -apple-system, sans-serif;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-strong);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #app { max-width: 100%; min-width: 0; }
html { scrollbar-gutter: stable; }
body:has(.modal-backdrop) { overflow: hidden; }
body { font-family: var(--font-ui); font-size: 14px; line-height: 1.55; color: var(--ink-strong); }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
button { min-height: var(--control-height); line-height: 1.3; }

/* 标题层级 */
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: 24px; line-height: 1.3; }
h2 { font-size: 16px; line-height: 1.4; }
h3 { font-size: 14px; line-height: 1.45; }
.toolbar h1 { font-size: 24px; }
.auth-card h1 { font-size: 24px; margin: 16px 0 0; }
.panel h2 { font-size: 16px; }
.task-title h3 { font-size: 14px; }
.brand b { font-size: 16px; }
.brand-name span:first-child { color: var(--brand-red); }
.modal h2 { font-size: 18px; }
.muted, .eyebrow, .crumb, small { font-size: 12px; }
.eyebrow { color: #996a3f; }

/* 品牌头部：兼容现有 .brand，也支持主助手补入的 .brand-name / .auth-brand */
.brand, .auth-brand { min-width: 0; }
.brand > div, .brand-name { min-width: 0; }
.brand-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; line-height: 1.25; }
.brand-name span { display: inline-block; overflow-wrap: anywhere; }
.brand b, .brand-name { color: var(--ink-strong); font-weight: 700; }
.brand small { color: var(--ink-muted); }
.auth-brand { display: block; color: var(--brand-red); font-size: 18px; font-weight: 700; text-align: center; line-height: 1.35; overflow-wrap: anywhere; }

/* 面板、卡片、表单 */
.panel, .stat, .auth-card, .callout, .modal {
  border-color: var(--line);
  border-radius: var(--radius-card);
}
.panel { padding: var(--space-card); }
.stat { padding: 16px 18px; }
.stack { gap: 16px; }
.panel-head { gap: 12px; margin-bottom: 14px; min-width: 0; }
.panel-head > * { min-width: 0; }

.auth-card { width: min(100%, 430px); padding: 36px; }
.auth-card form, .form-grid { gap: 14px; }
.auth-card label, .form-grid label { gap: 6px; font-size: 13px; min-width: 0; }

.auth-card input, .form-grid input, .form-grid select, .form-grid textarea,
.inline input, .project-switch select, .filters select, .ask-input {
  min-width: 0;
  min-height: var(--control-height);
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #dcd8d2;
  border-radius: var(--radius-control);
  color: var(--ink-strong);
  background: var(--surface);
}
.auth-card input, .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .form-grid select, .inline input, .project-switch select, .filters select { height: var(--control-height); line-height: 20px; }
input[type="file"] { padding: 4px !important; font-size: 12px !important; }
input[type="file"]::file-selector-button { font: inherit; border: 0; border-radius: 5px; padding: 6px 9px; margin-right: 7px; color: #655247; background: #f5eee7; }
fieldset.audience-choice { min-width: 0; margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-control); }
fieldset.audience-choice legend { font-size: 13px; padding: 0 4px; }
.notice-error { background: #fff0e9; color: #a92b16; border-left: 3px solid var(--brand-red); }
.form-grid textarea, .ask-input { min-height: 92px; resize: vertical; }
.auth-card input:focus, .form-grid input:focus, .form-grid select:focus,
.form-grid textarea:focus, .ask-input:focus {
  border-color: var(--brand-red);
  outline: 0;
  box-shadow: 0 0 0 3px var(--brand-red-soft);
}

/* 红色主按钮、浅色次按钮保持统一触控尺寸 */
.primary, .secondary { min-height: var(--control-height); padding: 8px 15px; border-radius: var(--radius-control); font-weight: 700; }
.primary { background: var(--brand-red); color: #fff; }
.primary:hover { background: var(--brand-red-dark); }
.secondary { background: #f5eee7; color: #655247; }
.secondary:hover { background: #eee4dc; }
.text-button, .plain { min-height: 36px; }

/* 复选框与文字分开布局，避免整行被输入框样式覆盖 */
.check, label.check, .check label { display: flex !important; align-items: center; gap: 8px; min-height: 32px; line-height: 1.45; }
.check input[type="checkbox"], .check input[type="radio"], input[type="checkbox"], input[type="radio"] {
  flex: 0 0 auto;
  width: 16px !important;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--brand-red);
}
.check input + *, input[type="checkbox"] + *, input[type="radio"] + * { min-width: 0; }

/* 弹窗标题、关闭、底部动作 */
.modal-backdrop { padding: 18px; overscroll-behavior: contain; }
.modal { width: min(680px, 100%); padding: 22px; }
.modal .panel-head { align-items: flex-start; }
.modal .panel-head > div { min-width: 0; flex: 1; }
.modal .panel-head h2 { margin: 4px 0 0; overflow-wrap: anywhere; }
.modal .panel-head > .plain { flex: 0 0 auto; min-width: 40px; min-height: 40px; padding: 4px 10px; color: var(--ink-muted); font-size: 24px; line-height: 1; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 12px; }
.modal-actions > button { min-width: 88px; }
.modal-error, .banner, .notice { overflow-wrap: anywhere; }

/* 名称、记录、按钮组在桌面与窄屏都允许收缩换行 */
.record-row, .task-card, .toolbar, .toolbar-actions, .record-buttons, .task-actions, .inline { min-width: 0; }
.record-main, .task-main, .task-title, .record-buttons, .task-actions { min-width: 0; overflow-wrap: anywhere; }
.record-buttons, .task-actions, .toolbar-actions { flex-wrap: wrap; }
.record-buttons { flex-shrink: 1; }
.record-main b, .record-main small, .task-main p, .task-title h3, .tag { overflow-wrap: anywhere; }
.record-main b { font-size: 14px; }
.record-main small, .task-main p, .plain-list span, .timeline-item p, .timeline-item details { font-size: 12px; }
.task-meta, .stat small, .project-switch small, .tag { font-size: 12px; }
.stat strong { font-size: 26px; }
.ask-modal input.ask-text { min-height: var(--control-height); height: var(--control-height); }
.filters select { width: auto; }
.auth-links button, .text-button, .plain, .tabrow button { font-size: 12px; }
.publication-content, .readonly-detail, .secret, pre { overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 680px) {
  :root { font-size: 13px; --space-card: 12px; --control-height: 38px; }
  body { font-size: 13px; line-height: 1.5; }
  button, input, select, textarea { font-size: 13px; }
  h1, .toolbar h1 { font-size: 20px; }
  h2 { font-size: 16px; }
  h3 { font-size: 14px; }
  .modal h2 { font-size: 18px; }
  .muted, .eyebrow, .crumb, small { font-size: 11px; }
  .top { min-width: 0; }
  .brand-name { font-size: 13px; gap: 0 3px; }
  .brand b { font-size: 13px; }
  .brand-name span { max-width: 100%; }
  .brand b { white-space: normal; overflow-wrap: anywhere; }
  .auth-wrap { padding: 18px 14px; }
  .auth-card { padding: 24px 20px; }
  .auth-brand { font-size: 16px; }
  .auth-card h1 { font-size: 20px; }
  .panel { padding: var(--space-card); }
  .panel h2 { font-size: 16px; }
  .task-title h3, .record-main b { font-size: 14px; }
  .record-main small, .task-main p, .plain-list span, .task-meta, .stat small, .project-switch small, .tag { font-size: 11px; }
  .stat strong { font-size: 24px; }
  .project-switch > select { min-height: 38px; font-size: 12px; }
  .project-switch > button { font-size: 11px; }
  .sidebar nav button { font-size: 11px; }
  .task-actions .secondary, .toolbar-actions button, .panel-head .primary, .panel-head .secondary { font-size: 12px; }
  .two-col .text-button { font-size: 12px; }
  .panel-head { align-items: flex-start; margin-bottom: 9px; }
  .toolbar { gap: 8px; }
  .toolbar-actions { max-width: 100%; }
  .toolbar-actions > button { min-height: 38px; }
  .form-grid { gap: 11px; }
  .form-grid input, .form-grid select, .form-grid textarea, .auth-card input { min-height: 38px; padding: 8px 10px; }
  .form-grid input:not([type="checkbox"]):not([type="radio"]), .form-grid select, .form-grid textarea, .auth-card input { font-size: 16px; }
  .form-grid textarea, .ask-input { min-height: 84px; }
  .primary, .secondary { min-height: 38px; padding: 7px 12px; }
  .record-row { align-items: flex-start; flex-wrap: wrap; gap: 7px; }
  .record-buttons { width: 100%; justify-content: flex-start; }
  .task-card { align-items: flex-start; flex-direction: column; gap: 8px; }
  .task-actions { align-self: stretch; justify-content: flex-end; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100dvh - 20px); padding: 15px; border-radius: 11px; }
  .modal-actions { margin-top: 14px; }
  .modal-actions > button { flex: 1 1 110px; min-width: 0; min-height: 42px; }
  .modal .panel-head > .plain { min-width: 40px; min-height: 40px; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .content { padding-left: 10px; padding-right: 10px; }
  .auth-card { padding-left: 16px; padding-right: 16px; }
  .brand-name { max-width: 104px; line-height: 1.2; }
  .topright { gap: 2px; }
  .topright > .plain { padding-left: 4px; padding-right: 4px; }
  .two-col { grid-template-columns: 1fr; }
  .modal { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 360px) {
  .brand-name { max-width: 92px; }
  .toolbar-actions > button { padding-left: 8px; padding-right: 8px; }
  .record-buttons .text-button, .task-actions .text-button { min-height: 38px; padding-left: 6px; padding-right: 6px; }
}

.highlight-row{display:flex;flex-direction:column;gap:4px;padding:10px 0;border-bottom:1px solid var(--line,#e8e2df)}.highlight-row:last-child{border-bottom:0}.highlight-row span{color:#766c67;font-size:13px;line-height:1.55}

.visit-heading{display:flex;align-items:flex-start;gap:12px}.visit-toggle{display:flex;flex:1;flex-direction:column;align-items:flex-start;gap:6px;border:0;background:none;text-align:left;padding:0;min-width:0}.visit-toggle h3{font-size:17px;margin:0}.visit-toggle small{font-size:12px;color:#776f69}.visit-items{margin-top:16px;border-top:1px solid #eee}.visit-item{display:flex;gap:12px;align-items:center;border-bottom:1px solid #eee;padding:12px 0}.visit-item .record-main{min-width:0;flex:1}.visit-item small{line-height:1.5}.history-overlay{z-index:90}.record-overlay{z-index:100}.timeline-editor-overlay{z-index:110}.file-preview-overlay{z-index:120}.history-event{padding:16px 0;border-bottom:1px solid #eee}.history-event-head{display:flex;justify-content:space-between;gap:12px}.history-event-head span,.history-event small{font-size:12px;color:#766c67}.history-event p,.history-intro{white-space:pre-wrap;overflow-wrap:anywhere}.file-link{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px 0}.file-link b{font-size:13px;overflow-wrap:anywhere;flex:1;min-width:120px}.linked-choice{max-height:180px;overflow:auto;border:1px solid #ddd;border-radius:8px;padding:10px}.linked-choice label{margin:6px 0}.file-preview-modal{width:min(900px,94vw)}.preview-meta{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:12px;color:#766c67}.preview-meta label{display:flex;align-items:center;gap:6px}.preview-content{margin-top:16px;overflow-wrap:anywhere}.preview-content img{display:block;max-width:100%;max-height:65vh;margin:auto}.preview-content iframe{width:100%;height:65vh;border:1px solid #ddd}.preview-content pre{white-space:pre-wrap;font-family:inherit;font-size:14px;line-height:1.6}.preview-content p{white-space:pre-wrap}.preview-table-scroll{overflow:auto;max-width:100%;margin:12px 0}.preview-content table{border-collapse:collapse;font-size:13px;min-width:100%}.preview-content td{border:1px solid #ddd;padding:8px;min-width:90px;white-space:pre-wrap}.preview-warning{font-size:13px;color:#965e20}.preview-content details{margin:12px 0}.preview-content summary{font-weight:600;cursor:pointer}@media(max-width:600px){.visit-item{align-items:flex-start;flex-direction:column;gap:4px}.visit-item .record-buttons{align-self:flex-end}.visit-toggle h3{font-size:15px}.history-event-head{flex-direction:column;gap:4px}.file-link{gap:4px}.file-link b{flex-basis:100%}.file-preview-modal{width:100%;max-width:100%}.preview-content iframe{height:55vh}.preview-meta{gap:6px}}
.task-filters{display:flex;flex-wrap:wrap;gap:8px}.task-filters select{min-width:120px}.priority-urgent{background:#fee2e2;color:#a31212}.priority-high{background:#fff2d5;color:#86590b}.priority-normal{background:#e8f7f4;color:#126e70}.batch-row{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}.batch-row span{font-size:12px;color:var(--ink-muted)}.invite-summary{display:flex;flex-direction:column;gap:4px;margin:14px 0;padding:12px;border:1px solid #efc7b7;border-radius:9px;background:var(--brand-red-soft)}.employee-overlay{z-index:150}.member-checks{max-height:180px;overflow:auto;border:1px solid var(--line);border-radius:8px;padding:10px}.upload-progress-panel{position:fixed;right:20px;bottom:20px;z-index:170;width:min(340px,calc(100vw - 24px));max-height:45vh;overflow:auto;padding:12px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 35px #40201022}.upload-progress-row{display:grid;grid-template-columns:1fr auto;gap:5px 10px;padding:7px 0;border-bottom:1px solid var(--line)}.upload-progress-row b{overflow-wrap:anywhere}.upload-progress-row progress,.upload-progress-row small{grid-column:1/-1;width:100%}@media(max-width:680px){.task-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.task-filters select{min-width:0;width:100%}.batch-row{flex-direction:column;gap:4px}.upload-progress-panel{right:12px;bottom:12px}}


/* A visible axis with three separate detail levels. */
.axis-tabs,.history-filters,.detail-navigation{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.detail-navigation{justify-content:space-between}.visit-axis{position:relative;padding:0 0 0 30px;margin:8px 0}.visit-axis:before{content:"";position:absolute;left:8px;top:10px;bottom:25px;width:2px;background:#b83528}.axis-node{position:relative;margin:0 0 24px}.axis-dot{position:absolute;left:-28px;top:8px;width:14px;height:14px;background:#b83528;border:3px solid #fff;border-radius:50%;box-shadow:0 0 0 2px #b83528}.axis-date{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:#8e3129;margin:0 0 10px}.axis-card{display:block;width:100%;text-align:left;background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px;color:var(--ink);box-shadow:0 3px 14px #40201008}.axis-card:hover{border-color:#b83528;background:#fffdfb}.axis-card h3{font-size:18px;line-height:1.4;margin:0 0 9px}.axis-summary{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:14px;font-weight:400;line-height:1.6;white-space:pre-wrap}.axis-people{font-size:12px;color:var(--ink-muted);font-weight:400;margin:10px 0}.axis-count{display:flex;justify-content:space-between;gap:8px;color:#8e3129;font-size:12px;font-weight:400;margin-top:14px}.visit-summary{white-space:pre-wrap}.visit-overview h2{margin:12px 0 6px}.visit-detail-item{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line);padding:14px 0}.visit-detail-item small{display:block;margin-top:5px}.visit-material{border-bottom:1px solid var(--line);padding:12px 0}.subject-detail .history-event{padding:18px 0}.artifact-label{flex:1;min-width:130px}.artifact-label small{display:block;font-size:12px;color:var(--ink-muted);line-height:1.6;overflow-wrap:anywhere}.history-filters{margin:16px 0}.axis-card,.visit-detail-item,.visit-overview{overflow-wrap:anywhere}.timeline-pages .subject-detail{min-width:0}@media(max-width:600px){.visit-axis{padding-left:23px}.visit-axis:before{left:6px}.axis-dot{left:-23px;width:13px;height:13px}.axis-card{padding:14px;border-radius:10px}.axis-card h3{font-size:16px}.axis-node{margin-bottom:18px}.axis-summary{font-size:13px}.axis-tabs button,.history-filters button{padding:8px 12px}.visit-detail-item{align-items:flex-start;flex-direction:column;gap:5px}.visit-detail-item>.text-button{align-self:flex-end}.artifact-label{flex-basis:100%}.detail-navigation button{font-size:12px}.subject-detail .record-detail-row{grid-template-columns:90px minmax(0,1fr)}}
