/* 千禾引擎统一主题：保留原页面结构、功能事件和数据接口。 */
:root {
    --qh-primary: #2e80f7;
    --qh-primary-dark: #2d67d6;
    --qh-violet: #6659e7;
    --qh-text: #102450;
    --qh-body: #1b2d4d;
    --qh-muted: #607089;
    --qh-border: #dce6f3;
    --qh-surface: #fff;
    --qh-soft: #edf5ff;
    --qh-success: #198658;
    --qh-warning: #a86612;
    --qh-danger: #c74444;
    --qh-shadow: 0 4px 20px rgb(32 69 119 / 4%);
}

body {
    margin: 0;
    padding: 0 0 32px !important;
    background: #f3f7fd !important;
    color: var(--qh-body);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif !important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
button, a, [onclick] { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid #91bdfb;
    outline-offset: 3px;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--qh-primary) !important;
    box-shadow: 0 0 0 3px rgb(46 128 247 / 12%) !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea {
    border-color: var(--qh-border);
    border-radius: 8px;
    color: var(--qh-body);
    min-height: 38px;
}
a { color: var(--qh-primary-dark); }
h1, h2, h3, h4 { color: var(--qh-text); letter-spacing: -.025em; }
.qh-topbar {
    background: #fff;
    border-bottom: 1px solid var(--qh-border);
    min-height: 72px;
    margin-bottom: 28px;
}
.qh-topbar-inner {
    max-width: 1600px;
    margin: auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    min-height: 72px;
}
.qh-brand { display: flex; align-items: center; flex-shrink: 0; gap: 18px; text-decoration: none; }
.qh-brand img { width: 112px; height: 38px; object-fit: contain; }
.qh-brand span { border-left: 1px solid var(--qh-border); padding-left: 18px; font-size: 14px; font-weight: 600; color: var(--qh-muted); }
.qh-nav { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.qh-nav a { text-decoration: none; color: var(--qh-muted); padding: 10px 13px; border-radius: 8px; white-space: nowrap; font-size: 14px; display: inline-flex; gap: 7px; align-items: center; }
.qh-nav a:hover { color: var(--qh-primary-dark); background: #f5f8fe; }
.qh-nav a.active { color: var(--qh-primary-dark); background: var(--qh-soft); font-weight: 600; }
.qh-icon { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; vertical-align: -.2em; }
.qh-skip { position: absolute; left: 16px; top: -80px; padding: 10px; background: #fff; z-index: 9999; }
.qh-skip:focus { top: 8px; }
body > .container {
    max-width: 1600px !important;
    width: 100%;
    margin: 0 auto !important;
    padding: 0 32px !important;
}
.dashboard-header, .header, .team-section, .gantt-section, .main-content,
.member-card, .module-card, .system-card, .card, .table-section, .summary-card,
.upload-section, .instructions, .flow-section, .profile-card {
    border: 1px solid var(--qh-border);
    box-shadow: var(--qh-shadow) !important;
    border-radius: 14px !important;
}
.dashboard-header, .header {
    background: #fff !important;
    color: var(--qh-body) !important;
    padding: 26px 28px !important;
    margin-bottom: 24px !important;
}
.header { display: block; }
.header h1, .dashboard-header h1 { font-size: 26px !important; color: var(--qh-text) !important; margin-bottom: 6px !important; line-height: 1.35; }
.header .subtitle, .header .update-time, .subtitle { color: var(--qh-muted); opacity: 1 !important; font-size: 14px; }
.header .update-time { font-size: 12px; }
.header-content { gap: 18px; margin-bottom: 20px; }
.page-heading { flex: 1; min-width: 240px; }
.page-eyebrow { font-size: 10px; letter-spacing: .16em; color: var(--qh-primary-dark); font-weight: 700; display: block; margin-bottom: 5px; }
.page-heading p { color: var(--qh-muted); font-size: 13px; margin: 5px 0 0; }
.header-content > .team-members { width: auto; margin-left: 0; }
.user-info { background: #f5f8fd; border: 1px solid var(--qh-border); border-radius: 10px; padding: 8px 12px; margin-left: 0; }
.user-avatar { border-radius: 9px; font-size: 12px; font-weight: 700; }
.user-name, .member-name { color: var(--qh-text); }
.team-count { color: var(--qh-muted); font-size: 13px; }
.header-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
.header-actions .btn { font-weight: 500; padding: 9px 12px; }
.header-actions .btn:not([onclick="openGroupTaskModal()"]) { background: #f4f8fe !important; color: #365171 !important; box-shadow: none !important; border: 1px solid var(--qh-border); }
.header-actions .btn[onclick="openGroupTaskModal()"] { margin-left: auto; }
.ai-warning-banner {
    justify-content: flex-start;
    background: #edf5ff !important;
    color: #406391;
    padding: 10px 14px;
    border: 1px solid #d7e8fe;
    border-radius: 8px;
    box-shadow: none;
    margin-bottom: 20px;
}
.ai-warning-icon { font-size: 18px; color: var(--qh-primary-dark); }
.ai-warning-text { font-size: 13px; font-weight: 400; letter-spacing: 0; }
.btn, .action-btn, .btn-login { border-radius: 8px !important; transition: background .16s, box-shadow .16s, color .16s !important; }
.btn-primary, .action-btn.primary, .btn-login {
    background: var(--qh-primary-dark) !important;
    color: #fff !important;
    border: 1px solid transparent;
}
.btn-primary:hover, .action-btn.primary:hover, .btn-login:hover { background: #2559c0 !important; transform: none !important; box-shadow: 0 3px 9px rgb(46 128 247 / 18%) !important; }
.btn-secondary, .action-btn.secondary, .back-link, .back-btn { background: #f1f6fd; color: #365171; border: 1px solid var(--qh-border); }
.btn-secondary:hover, .action-btn.secondary:hover { background: #e5effb; transform: none; }
.btn-logout { background: #fff !important; color: var(--qh-muted) !important; border: 1px solid var(--qh-border); }
.btn-danger { background: #fff1f1 !important; color: var(--qh-danger) !important; border: 1px solid #f1cece; }
.btn-add-task { border-width: 1px; background: #f5f9ff; color: var(--qh-primary-dark); }
.stats-panel { gap: 12px; }
.stat-card { background: #f8fbff; border: 1px solid var(--qh-border); border-radius: 10px; box-shadow: none; padding: 17px 20px; }
.stat-card:hover, .member-card:hover, .module-card:hover, .system-card:hover { transform: none; box-shadow: var(--qh-shadow); }
.stat-value { color: var(--qh-text); font-variant-numeric: tabular-nums; font-size: 28px; line-height: 1.25; }
.stat-label { color: var(--qh-muted); font-size: 13px; }
.stat-icon { width: 40px; height: 40px; background: #edf3fc; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--qh-primary-dark); }
.stat-icon .qh-icon { width: 22px; height: 22px; }
.view-toggle { background: #edf2f9; border-radius: 8px; padding: 3px; }
.toggle-btn, .view-btn { border-radius: 6px; font-size: 13px; }
.toggle-btn.active, .view-btn.active { background: #fff !important; color: var(--qh-primary-dark) !important; box-shadow: 0 1px 4px rgb(16 36 80 / 10%); }
.platform-tab.active, .filter-btn.active, .tab.active, .module-tab.active { background: var(--qh-soft) !important; color: var(--qh-primary-dark) !important; border-color: #c2d9fc !important; }
.team-section { gap: 20px; padding: 18px 22px; margin-bottom: 18px; }
.gantt-toolbar, .toolbar { flex-wrap: wrap; gap: 12px; }
.toolbar-right { flex-wrap: wrap; gap: 8px; }
.gantt-toolbar h2 { font-size: 18px; }
.gantt-toolbar .btn:not(.btn-primary) { background: #f1f6fd !important; color: #365171 !important; border: 1px solid var(--qh-border); }
.module-tabs { flex-wrap: wrap; gap: 4px; padding: 8px; }
.module-tab { border-radius: 7px; padding: 9px 14px; font-size: 13px; }
.gantt-header, table th { background: #f3f7fc; color: #536781; border-color: var(--qh-border); }
.gantt-container, .table-container { max-width: 100%; overflow-x: auto; }
.gantt-section { background: #fff; }
table td, table th { border-color: #e6edf7; }
.task-card { border-radius: 9px; border-color: #e0e8f4; box-shadow: none; }
.member-panel { background: #fff; border: 1px solid var(--qh-border); border-radius: 14px; box-shadow: var(--qh-shadow); }
.member-panel:hover { transform: none; box-shadow: var(--qh-shadow); }
.member-header-simple { border-bottom: 1px solid var(--qh-border); }
.workload-summary { background: #edf4ff; color: #4b6792; box-shadow: none; border-radius: 7px; }
.progress-bar-fill { background: var(--qh-primary); }
.task-title { color: var(--qh-text); }
.task-description, .task-meta, .member-role { color: var(--qh-muted); }
.modal-content { border: 1px solid var(--qh-border); border-radius: 14px; max-width: calc(100vw - 32px); box-shadow: 0 18px 60px rgb(16 36 80 / 18%); }
.modal-footer { flex-wrap: wrap; gap: 12px; }
.empty-state, .module-empty { color: var(--qh-muted); padding: 56px 24px; }
.qh-footer { text-align: center; color: var(--qh-muted); font-size: 11px; margin-top: 28px; letter-spacing: .02em; }

/* 登录页 */
body.qh-login { min-height: 100vh; padding: 0 !important; display: block; background: #f4f8ff !important; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(480px, 1.08fr) minmax(440px, 1fr); }
.login-intro { position: relative; overflow: hidden; background: linear-gradient(145deg, #eaf4ff 0%, #eef1ff 100%); padding: 48px 64px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand { width: 148px; height: 52px; object-fit: contain; }
.intro-copy { max-width: 490px; position: relative; z-index: 1; margin: 60px 0; }
.intro-copy .eyebrow { color: #3266bc; font-size: 12px; letter-spacing: .14em; font-weight: 600; margin-bottom: 20px; }
.intro-copy h1 { color: var(--qh-text); font-size: clamp(34px, 3.2vw, 48px); line-height: 1.45; letter-spacing: -.03em; margin-bottom: 20px; }
.intro-copy h1 span { color: var(--qh-primary-dark); }
.intro-copy p { color: #5b7091; line-height: 1.9; max-width: 390px; font-size: 15px; }
.intro-features { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.intro-features span { border: 1px solid #d1e1f8; background: rgb(255 255 255 / 65%); padding: 8px 14px; border-radius: 8px; font-size: 12px; color: #3e5d8c; }
.intro-bottom { color: #697c98; font-size: 12px; position: relative; z-index: 1; }
.login-orbit { position: absolute; width: 580px; height: 580px; border: 1px solid #d1dff7; border-radius: 50%; right: -370px; bottom: -150px; }
.login-orbit::before, .login-orbit::after { content: ""; position: absolute; border: 1px solid #d1dff7; border-radius: 50%; }
.login-orbit::before { inset: 55px; }
.login-orbit::after { inset: 110px; }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 48px; }
.login-container { background: #fff; border: 1px solid var(--qh-border); border-radius: 18px; width: 100%; max-width: 410px; padding: 38px; box-shadow: 0 10px 36px rgb(34 67 113 / 5%); }
.login-header { text-align: left; margin-bottom: 30px; }
.login-header .login-kicker { font-size: 11px; letter-spacing: .12em; color: var(--qh-primary-dark); font-weight: 600; margin-bottom: 10px; }
.login-header h2 { font-size: 25px; font-weight: 650; margin-bottom: 8px; }
.login-header p { font-size: 13px; color: var(--qh-muted); }
.qh-login .form-group { margin-bottom: 20px; }
.qh-login .form-group label { font-size: 13px; display: block; color: var(--qh-body); margin-bottom: 8px; font-weight: 500; }
.qh-login input { width: 100%; border: 1px solid var(--qh-border); border-radius: 8px; height: 46px; padding: 0 14px; font-size: 15px; background: #fafcff; }
.qh-login .btn-login { width: 100%; height: 46px; font-size: 14px; font-weight: 600; margin-top: 4px; cursor: pointer; }
.error-message { display: none; background: #fff1f1; color: var(--qh-danger); border: 1px solid #f0cccc; padding: 10px 12px; border-radius: 8px; margin-bottom: 18px; font-size: 13px; }
.login-footer { color: var(--qh-muted); font-size: 11px; text-align: center; margin-top: 26px; }

@media (max-width: 1120px) {
    .qh-topbar-inner { gap: 20px; padding: 0 24px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 10px; }
    .qh-nav { flex: 1; }
    .header-actions .btn[onclick="openGroupTaskModal()"] { margin-left: 0; }
    .login-intro { padding: 38px; }
    .login-layout { grid-template-columns: minmax(360px, 1fr) minmax(380px, 1fr); }
    .login-form-side { padding: 32px; }
}
@media (max-width: 768px) {
    .qh-topbar { margin-bottom: 18px; }
    .qh-topbar-inner { padding: 14px 16px 8px; gap: 10px; }
    .qh-brand img { width: 100px; height: 32px; }
    .qh-nav { width: 100%; flex-basis: 100%; }
    .qh-nav a { padding: 9px 12px; font-size: 13px; }
    body > .container { padding: 0 16px !important; }
    .dashboard-header, .header { padding: 20px !important; }
    .header h1, .dashboard-header h1 { font-size: 22px !important; }
    .page-heading { min-width: 100%; }
    .user-info { margin-right: auto; }
    .header-actions { gap: 8px; }
    .header-actions > .date-nav { flex-basis: 100%; }
    .date-nav input { flex: 1; min-width: 0; }
    .stats-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 13px 12px; gap: 10px; }
    .stat-value { font-size: 23px; }
    .stat-icon { width: 32px; height: 32px; }
    .stat-label { font-size: 12px; }
    .team-dashboard, .team-grid, .member-grid, .members-grid, .systems-grid, .modules-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .member-header-simple { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
    .member-panel { padding: 18px; }
    .search-box, .search-box input { width: 100%; min-width: 0; }
    .main-layout { grid-template-columns: minmax(0, 1fr) !important; }
    .main-content { grid-template-columns: minmax(0, 1fr); }
    .toolbar, .gantt-toolbar { padding: 16px; }
    .toolbar-left { flex-wrap: wrap; min-width: 0; gap: 12px; }
    .toolbar-left h2 { width: 100%; }
    .filter-btn { white-space: nowrap; }
    .team-section { padding: 16px; gap: 14px; }
    .platform-tabs { flex-wrap: wrap; gap: 6px; }
    .platform-tab { flex: 1 1 40%; padding: 11px; }
    .modal-content { width: calc(100vw - 24px); padding: 20px; max-height: 90vh; overflow-y: auto; }
    .modal-footer > div { flex-wrap: wrap; }
    .form-row { grid-template-columns: minmax(0, 1fr); }
    input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
    .login-layout { grid-template-columns: 1fr; min-height: 100dvh; }
    .login-intro { padding: 26px 24px 20px; }
    .login-brand { width: 128px; height: 42px; }
    .intro-copy { margin: 22px 0 0; }
    .intro-copy h1 { font-size: 26px; margin-bottom: 8px; }
    .intro-copy p { font-size: 13px; }
    .intro-copy .eyebrow, .intro-features, .intro-bottom { display: none; }
    .login-form-side { padding: 26px 20px 36px; align-items: start; }
    .login-container { padding: 28px 24px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
    .qh-topbar, .qh-footer, .qh-skip { display: none !important; }
    body { background: #fff !important; padding: 0 !important; }
    body > .container { padding: 0 !important; }
    .header, .dashboard-header, .gantt-section { box-shadow: none !important; }
}
