/* 全局基础样式 - 内部使用，简单清爽即可 */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f4f6f9;
    color: #2c3e50;
    font-size: 14px;
}

/* 顶部导航 */
.topbar {
    background: #1f2d3d;
    color: #fff;
    padding: 0 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.brand {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 17px;
}
.topbar nav a {
    color: #d6deea;
    text-decoration: none;
    margin-left: 16px;
    padding: 4px 0;
}
.topbar nav a:hover { color: #fff; }
.topbar nav a.btn-logout { color: #ffb3b3; }
.user-info {
    margin-left: 16px;
    color: #fff;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    background: #eef2f7;
    color: #4a5568;
}
.badge-admin { background: #ffe4ce; color: #b35c00; }
.badge-sysadmin { background: #fcdede; color: #a02020; }
.badge-user   { background: #e0eaf8; color: #1f5fb0; }
.badge-ok    { background: #d8f0d8; color: #1f7a1f; }
.badge-warn  { background: #fff0cc; color: #9a6b00; }
.badge-bad   { background: #fcdede; color: #a02020; }

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 20px;
}

/* 表格 */
.proto-table, .detail-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.proto-table th, .proto-table td,
.detail-table th, .detail-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eef0f3;
}
.proto-table th, .detail-table th {
    background: #fafbfc;
    font-weight: 600;
    color: #6b7785;
}
.detail-table th { width: 130px; }
.col-action { white-space: nowrap; }
.proto-table a { color: #1f5fb0; text-decoration: none; }
.proto-table a:hover { text-decoration: underline; }

/* ========== 看板 ========== */
.dashboard {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.dash-card {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 18px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    text-align: center;
    min-width: 0;
}
.dash-val { font-size: 26px; font-weight: 700; color: #1f6fe5; }
.dash-label { font-size: 11px; color: #8492a6; margin-top: 4px; }
.dash-chart-full {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}
.dash-chart-title { font-weight: 700; margin-bottom: 12px; color: #2c3e50; font-size: 13px; }
.bar-chart {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    max-height: 200px;
    overflow-y: auto;
}
.bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 260px;
    flex: 1;
    font-size: 11px;
}
.bar-label {
    width: 65px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    color: #4a5568;
}
.bar-track {
    flex: 1;
    height: 12px;
    background: #eef0f3;
    border-radius: 3px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1f6fe5, #4d8ff7);
    border-radius: 3px;
    min-width: 2px;
}
.bar-count {
    width: 24px;
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
    font-size: 11px;
}
.bar-more { width: 100%; text-align: center; color: #8492a6; font-size: 11px; }

/* ========== 筛选栏 ========== */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.filter-bar select {
    padding: 5px 8px;
    border: 1px solid #d6dce5;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    max-width: 140px;
}
.filter-count { font-size: 12px; color: #8492a6; margin-left: auto; }

/* ========== 表格优化 ========== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.td-mono { font-size: 13px; font-family: "SF Mono", "Consolas", monospace; font-weight: 500; }
.proto-table-compact { font-size: 12px; }
.proto-table-compact th,
.proto-table-compact td { padding: 7px 8px; white-space: nowrap; }
.proto-table-compact th { font-size: 11px; }
.proto-table-compact .col-action { white-space: nowrap; }
.proto-table-compact .col-thumb { width: 90px; padding: 2px 4px; }

/* 缩略图容器 */
.thumb-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    position: relative;
}

/* 全屏预览遮罩 */
.thumb-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    cursor: default;
    animation: overlayIn 0.2s ease-out forwards;
}
@keyframes overlayIn {
    to { background: rgba(0,0,0,0.6); }
}

/* 预览大图 */
.thumb-preview-img {
    display: block;
    max-width: 40vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    background: #fff;
    padding: 4px;
    animation: previewIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
@keyframes previewIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 预览中心区 */
.thumb-pv-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* 查看详情链接 */
.thumb-pv-detail {
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    padding: 6px 20px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    transition: all 0.15s;
}
.thumb-pv-detail:hover {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
}

/* 预览翻页按钮 */
.thumb-pv-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    animation: btnIn 0.3s ease-out forwards;
    opacity: 0;
}
.thumb-pv-prev { animation-delay: 0.05s; }
.thumb-pv-next { animation-delay: 0.1s; }
@keyframes btnIn {
    from { opacity: 0; transform: translateX(0); }
    to   { opacity: 1; transform: translateX(0); }
}
.thumb-pv-btn:hover {
    background: rgba(0,0,0,0.7);
    border-color: #fff;
    transform: scale(1.1);
}
.thumb-pv-disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
    animation: none;
}

/* 图片张数角标 */
.thumb-count {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    padding: 1px 4px;
    border-radius: 6px;
    pointer-events: none;
}

/* 重难点项目行 */
.key-project-row { background: #fff0f0 !important; }
.key-project-row:hover { background: #ffe0e0 !important; }

/* 列表缩略图 */
.proto-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e4ea;
    vertical-align: middle;
    cursor: pointer;
    flex-shrink: 0;
}

.tag-pl {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}
.tag-pl[data-v="国内"], .tag-pl:contains("国内") { background: #e0f0ff; color: #1f5fb0; }

@media (max-width: 640px) {
    .dashboard { flex-wrap: wrap; }
    .dash-card { flex: 1 1 40%; min-width: 100px; }
    .filter-bar select { max-width: 100px; font-size: 11px; }
}

/* 页头 */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-head h2 { margin: 0; }
.page-sub { color: #8492a6; margin: 4px 0 0; }

/* 搜索表单 */
.search-form {
    display: flex;
    gap: 6px;
    align-items: center;
}
.search-form input {
    padding: 6px 10px;
    border: 1px solid #d6dce5;
    border-radius: 4px;
    min-width: 240px;
}

/* 卡片（登录/注册/详情用） */
.auth-card {
    max-width: 460px;
    margin: 40px auto;
    background: #fff;
    padding: 28px 32px;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.auth-card.wide { max-width: 640px; }
.auth-card h2 { margin-top: 0; }
.auth-card label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    color: #4a5568;
}
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card select,
.auth-card textarea {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 6px;
    border: 1px solid #d6dce5;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.auth-card textarea { resize: vertical; }
.auth-card .hint { display: block; margin-top: 4px; color: #90a0b3; font-weight: 400; font-size: 12px; }
.auth-card .required { color: #d03030; }
.auth-tip { color: #8492a6; margin-top: 18px; }
.auth-tip a { color: #1f5fb0; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    color: #2c3e50;
    border: 1px solid #d6dce5;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}
.btn:hover { background: #f4f6f9; }
.btn-primary { background: #1f6fe5; color: #fff; border-color: #1f6fe5; }
.btn-primary:hover { background: #1a5fc7; }
.btn-danger { background: #d03030; color: #fff; border-color: #d03030; }
.btn-danger:hover { background: #b02828; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.inline { display: inline; }

.form-actions { display: flex; gap: 8px; margin-top: 8px; }

/* 提示条 */
.flash {
    background: #fff8d6;
    color: #9a6b00;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    border: 1px solid #f0d870;
    white-space: pre-line;   /* 支持 \n 换行（导入错误多条要用） */
    line-height: 1.6;
    max-height: 320px;
    overflow-y: auto;
}

/* Excel 工具栏 */
.excel-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.excel-bar .hint { color: #8492a6; font-size: 12px; }
.file-picker { cursor: pointer; }

/* 二维码批量打印 - 选择页 */
.qr-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.qr-toolbar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 6px 10px;
    border: 1px solid #d6dce5;
    border-radius: 4px;
}
.qr-toolbar .hint { color: #8492a6; font-size: 12px; }

.qr-select-table .col-chk {
    width: 36px;
    text-align: center;
}
.qr-select-table .col-chk input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.qr-select-table tbody tr:hover { background: #f8fafc; }

.qr-submit-bar {
    position: sticky;
    bottom: 0;
    margin-top: 16px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 空态 */
.empty {
    background: #fff;
    padding: 40px;
    text-align: center;
    color: #8492a6;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* 备注块 */
.desc {
    margin: 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 14px;
}

/* 页脚 */
.footer {
    text-align: center;
    color: #90a0b3;
    padding: 30px 0;
    font-size: 12px;
}

/* ========== 详情页 ========== */
.back-link { margin: 0 0 8px; }
.back-link a { color: #1f5fb0; text-decoration: none; font-size: 13px; }
.back-link a:hover { text-decoration: underline; }

.detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 768px) {
    .detail-columns { grid-template-columns: 1fr; }
}
.detail-section {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.detail-section h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #2c3e50;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef0f3;
}

.detail-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.detail-img-card {
    position: relative;
    width: 160px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e4ea;
    background: #fafbfc;
}
.detail-img-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    cursor: pointer;
}
.detail-img-tag {
    display: block;
    text-align: center;
    font-size: 11px;
    padding: 4px 6px;
    color: #8492a6;
    background: #f4f6f9;
}

.detail-meta {
    text-align: center;
    color: #90a0b3;
    font-size: 12px;
    padding: 12px 0;
}

/* 详情页操作区 */
.page-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 模态框内两列表单（快速录入用）*/
.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    text-align: left;
}
.form-grid-2col label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
}
.form-grid-2col input[type="text"],
.form-grid-2col select {
    display: block;
    width: 100%;
    padding: 7px 10px;
    margin-top: 4px;
    border: 1px solid #d6dce5;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
@media (max-width: 640px) {
    .form-grid-2col { grid-template-columns: 1fr; }
}

/* B 按钮：是否入库的切换 */
.save-db-toggle {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    background: #f4f6f9;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}
.save-db-toggle input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}
.save-db-toggle span {
    display: block;
    font-weight: 600;
    color: #2c3e50;
}
.save-db-toggle .hint {
    font-weight: 400;
    color: #8492a6;
    font-size: 12px;
    margin-top: 2px;
}

/* 选择页：未入库样机行的标记 */
.qr-select-table tr.row-unsaved {
    background: #fff8f0;
}
.qr-select-table tr.row-unsaved:hover {
    background: #fff0e0 !important;
}
.tag-unsaved {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    background: #ffe4ce;
    color: #b35c00;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

/* 预览页：未入库二维码标签的红色边框 + 标识 */
.qr-label.qr-label-unsaved {
    border: 2px dashed #d03030;
}
.qr-tag-unsaved {
    margin-top: 2mm;
    padding: 1mm 3mm;
    background: #fcdede;
    color: #a02020;
    border-radius: 3px;
    font-size: 9pt;
    font-weight: 500;
    display: inline-block;
}
@media print {
    .qr-label.qr-label-unsaved { border: 1px dashed #d03030; }
}

/* 二维码模态框 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}
.modal-card {
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}
.modal-card h3 { margin: 0 0 8px; }
.modal-card label {
    display: block;
    text-align: left;
    margin-bottom: 12px;
    font-weight: 600;
    color: #4a5568;
}
.modal-card input[type="password"] {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin-top: 4px;
    border: 1px solid #d6dce5;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.modal-card .form-actions {
    justify-content: flex-start;
}
.modal-card code {
    background: #eef2f7;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #1f5fb0;
}
.qr-box {
    display: inline-block;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin: 12px 0;
    background: #fff;
}
.qr-box img, .qr-box canvas { display: block; }

/* 表单分组（新增/编辑样品页） */
.form-section {
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fafbfc;
}
.form-section legend {
    font-weight: 700;
    font-size: 15px;
    color: #2c3e50;
    padding: 0 8px;
}

/* 宽卡片 */
.auth-card.wide { max-width: 900px; }

/* ========== 移动端响应式（iPhone 横屏以下） ========== */
@media (max-width: 640px) {
    body { font-size: 15px; }
    .container { padding: 0 12px; margin: 16px auto; }

    /* 顶部导航：允许折行 + 缩小 */
    .topbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 4px 12px;
        line-height: 1.5;
    }
    .brand { font-size: 15px; }
    .topbar nav a { margin-left: 0; margin-right: 10px; font-size: 13px; }
    .topbar nav a.btn-logout { margin-right: 0; }
    .user-info { margin-left: 0; font-size: 12px; }

    /* 表格横向滚动 + 缩字号（最稳，不破坏列结构）*/
    .proto-table { font-size: 13px; display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .detail-table { font-size: 14px; }
    .detail-table th { width: 100px; }

    /* 页头：垂直堆叠 */
    .page-head { flex-direction: column; align-items: stretch; gap: 8px; }
    .page-head-actions { justify-content: flex-end; }
    .search-form { width: 100%; }
    .search-form input { flex: 1; min-width: 0; }

    .excel-bar { padding: 8px; }
    .excel-bar .hint { display: none; }

    /* 卡片 */
    .auth-card { margin: 16px auto; padding: 18px; }
    .auth-card.wide { padding: 16px; }

    /* 模态框 */
    .modal-card { padding: 18px; }

    /* 按钮更大更好按 */
    .btn { padding: 8px 14px; }
    .btn-sm { padding: 5px 10px; }
}

/* ========== 通知中心页面 ========== */
.notif-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
}
.notif-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: #fafbfc;
    font-size: 14px;
    font-weight: 600;
    color: #6b7785;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.notif-tab.active {
    background: #fff;
    color: #1f6fe5;
    box-shadow: inset 0 -2px 0 #1f6fe5;
}
.notif-tab:hover { background: #f0f5ff; }
.notif-tab-badge {
    display: inline-block;
    background: #d03030;
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    text-align: center;
    margin-left: 6px;
    padding: 0 5px;
}
.notif-alert {
    background: #fff8d6;
    border: 1px solid #f0d870;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #9a6b00;
}
.notif-alert a { color: #1f5fb0; font-weight: 600; }

.notif-panel {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    gap: 12px;
}
.notif-card-body { flex: 1; min-width: 0; }
.notif-card-title { font-weight: 600; color: #2c3e50; font-size: 14px; }
.notif-card-title a { color: #1f5fb0; text-decoration: none; }
.notif-card-title a:hover { text-decoration: underline; }
.notif-part-number { font-size: 12px; color: #8492a6; font-weight: 400; margin-left: 6px; font-family: "SF Mono","Consolas",monospace; }
.notif-card-sub { font-size: 12px; color: #8492a6; margin-top: 2px; }
.notif-card-msg { color: #6b7785; font-size: 12px; margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.notif-miss-cat {
    display: inline-block;
    background: #fff0cc;
    color: #b35c00;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.notif-card-time { color: #90a0b3; font-size: 11px; margin-top: 4px; }
.notif-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ========== 铃铛通知 ========== */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.bell-icon-link {
    text-decoration: none;
    position: relative;
    display: inline-flex;
    align-items: center;
}
.bell-icon {
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    user-select: none;
}
.bell-icon:hover { opacity: 0.8; }
.bell-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #d03030;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}
.bell-preview {
    position: absolute;
    top: 36px;
    right: -10px;
    width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    z-index: 300;
    overflow: hidden;
}
.bell-preview-inner { max-height: 300px; overflow-y: auto; }
.bell-pv-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid #f4f6f9;
    text-decoration: none;
    color: #2c3e50;
    font-size: 12px;
}
.bell-pv-item:hover { background: #f8fafc; }
.bell-pv-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
.bell-pv-item small { color: #8492a6; }

/* 审核悬浮条 */
.review-float {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #fff8d6;
    border: 1px solid #f0d870;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #9a6b00;
}
.bell-dropdown {
    position: absolute;
    top: 36px;
    left: 0;
    width: 380px;
    max-height: 480px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    z-index: 200;
    overflow: hidden;
    text-align: left;
}
.bell-header {
    padding: 12px 16px;
    font-weight: 700;
    border-bottom: 1px solid #eef0f3;
    color: #2c3e50;
}
.bell-list { max-height: 360px; overflow-y: auto; }
.bell-empty {
    padding: 24px;
    text-align: center;
    color: #8492a6;
}
.bell-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f4f6f9;
    cursor: pointer;
    transition: background 0.15s;
}
.bell-item:hover { background: #f8fafc; }
.bell-unread { border-left: 3px solid #1f6fe5; }
.bell-item-title { font-weight: 600; color: #2c3e50; font-size: 13px; }
.bell-item-msg { color: #6b7785; font-size: 12px; margin-top: 4px; }
.bell-item-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}
.bell-footer {
    padding: 8px 16px;
    border-top: 1px solid #eef0f3;
    text-align: center;
}
.bell-footer a { color: #1f5fb0; font-size: 13px; text-decoration: none; }
.bell-footer a:hover { text-decoration: underline; }
@media (max-width: 640px) {
    .bell-dropdown { width: calc(100vw - 24px); left: -140px; }
}

/* ── 图片上传备注 ── */
.img-upload-note {
    background: #f0f7ff;
    border: 1px solid #b8d4f0;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #2c5f8a;
}

/* ── 图片状态栏 ── */
.img-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-bottom: 16px;
    font-size: 13px;
}
.img-status-ok { color: #1f7a1f; font-weight: 600; }
.img-status-warn { color: #b35c00; font-weight: 600; }
.img-status-count { color: #8492a6; }

/* ── 分类上传区块 ── */
.img-cat-block {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    padding: 16px;
    margin-bottom: 16px;
}
.img-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef0f3;
}
.img-cat-header h3 {
    margin: 0;
    font-size: 15px;
    color: #2c3e50;
}
.img-cat-done {
    font-size: 12px;
    font-weight: 400;
    color: #1f7a1f;
    background: #d8f0d8;
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: 8px;
}
.img-cat-missing {
    font-size: 12px;
    font-weight: 400;
    color: #b35c00;
    background: #fff0cc;
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: 8px;
}

/* ── 分类已上传图片 ── */
.img-cat-existing {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* ── 正方形网格布局 ── */
.img-cat-grid {
    display: grid;
    gap: 16px;
    max-width: 1100px;
}
.img-cat-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
}
.img-cat-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.img-cat-card-title {
    font-weight: 700;
    font-size: 16px;
    color: #2c3e50;
}
.img-cat-badge-done {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #1f7a1f;
    color: #fff;
    font-size: 14px;
    line-height: 26px;
    text-align: center;
    flex-shrink: 0;
    font-weight: 700;
}
.img-cat-badge-miss {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #d03030;
    color: #fff;
    font-size: 14px;
    line-height: 26px;
    text-align: center;
    flex-shrink: 0;
    font-weight: 700;
}
.img-cat-badge-opt {
    font-size: 10px;
    color: #8492a6;
    background: #f4f6f9;
    padding: 1px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}
.img-cat-optional {
    order: 99;
    opacity: 0.75;
}
.img-cat-done-card {
    border-left: 3px solid #1f7a1f;
}
.img-cat-missing-card {
    border-left: 3px solid #e8804a;
}

/* 已上传缩略图 */
.img-cat-card-pics {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.img-cat-card-pics img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e0e4ea;
    cursor: pointer;
}
.img-cat-card-more {
    width: 70px;
    height: 70px;
    background: #eef2f7;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #8492a6;
}

/* 紧凑拖拽区 */
.drop-zone-compact {
    padding: 24px 12px !important;
    border: 2px dashed #b0bec5 !important;
    border-radius: 8px !important;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}
.drop-zone-compact:hover {
    border-color: #1f6fe5 !important;
    background: #f0f5ff;
}
.drop-icon-sm {
    font-size: 28px;
    color: #b0bec5;
    font-weight: 700;
}
.drop-text-sm {
    font-size: 13px;
    color: #8492a6;
    margin-top: 4px;
}

/* 行内预览 */
.upload-preview-inline {
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    padding: 8px;
    background: #fafbfc;
}
.upload-preview-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: #8492a6;
}

/* 卡片底部 */
.img-cat-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid #eef0f3;
}
.img-cat-card-count {
    font-size: 11px;
    color: #8492a6;
    margin-right: auto;
}

@media (max-width: 640px) {
    .img-cat-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    .img-cat-card { padding: 12px; min-height: 180px; }
    .img-cat-card-pics img,
    .img-cat-card-more { width: 52px; height: 52px; }
}

/* ========== 图片库 ========== */
.image-upload-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}
.image-upload-section h3 { margin-top: 0; }
.upload-form { margin-top: 12px; }

.image-gallery {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.image-gallery h3 { margin-top: 0; }
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
/* 拖拽上传区 */
.drop-zone {
    border: 2px dashed #b0bec5;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
    margin-top: 12px;
}
.drop-zone:hover, .drop-zone-active {
    border-color: #1f6fe5;
    background: #f0f5ff;
}
.drop-zone-inner { pointer-events: none; }
.drop-icon { font-size: 40px; margin-bottom: 8px; }
.drop-text { font-size: 15px; font-weight: 600; color: #2c3e50; }
.drop-sub { font-size: 13px; color: #8492a6; margin-top: 4px; }

/* 上传预览 */
.upload-preview {
    margin-top: 16px;
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 16px;
}
.upload-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #6b7785;
    font-size: 13px;
}
.preview-list { max-height: 200px; overflow-y: auto; }
.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f4f6f9;
    font-size: 13px;
}
.preview-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-size { color: #8492a6; margin: 0 12px; white-space: nowrap; }

/* 上传进度条 */
.upload-progress { margin-top: 12px; }
.progress-bar {
    height: 6px;
    background: #eef0f3;
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: #1f6fe5;
    transition: width 0.3s;
    border-radius: 3px;
}
.progress-text { font-size: 12px; color: #8492a6; margin-top: 4px; text-align: center; }

.image-card {
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    overflow: hidden;
    background: #fafbfc;
    transition: box-shadow 0.15s;
}
.image-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.image-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
    background: #eef0f3;
}
.image-card-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
}
.image-cat {
    background: #e0eaf8;
    color: #1f5fb0;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 500;
}
.image-num { color: #8492a6; }
.image-card-name {
    padding: 0 10px 8px;
    font-size: 11px;
    color: #8492a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 密码重置表单 ── */
.pw-reset-form {
    background: #fff8d6;
    border: 1px solid #f0d870;
    border-radius: 6px;
    padding: 16px;
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.pw-reset-form p { width: 100%; margin: 0 0 4px; font-weight: 600; }
.pw-reset-form input[type="password"] {
    padding: 6px 10px;
    border: 1px solid #d6dce5;
    border-radius: 4px;
    font-size: 14px;
    width: 180px;
}

/* ── 编辑页图片管理 ── */
.form-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.form-image-card {
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    overflow: hidden;
    background: #fafbfc;
}
.form-image-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    cursor: pointer;
    background: #eef0f3;
}
.form-image-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 12px;
}
.form-upload-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #eef0f3;
}
.form-upload-row label {
    font-weight: 600;
    font-size: 13px;
    color: #4a5568;
}
.form-upload-row select,
.form-upload-row input[type="file"] {
    display: block;
    margin-top: 4px;
    padding: 6px 8px;
    border: 1px solid #d6dce5;
    border-radius: 4px;
    font-size: 13px;
}

/* ── CMF 文件解析 ── */
.cmf-upload-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0f7ff;
    border: 1px solid #b8d4f0;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.cmf-label {
    font-weight: 600;
    white-space: nowrap;
    color: #2c5f8a;
}
.cmf-upload-section input[type="file"] {
    font-size: 12px;
    max-width: 280px;
}
.cmf-status {
    font-size: 12px;
    margin-left: 4px;
    flex: 1;
}

/* ── 工艺难点/风险项 突出显示 ── */
.risk-alert {
    background: #fff5f0;
    border: 2px solid #e8804a;
    border-left: 6px solid #d45d2a;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.risk-alert-header {
    font-weight: 700;
    font-size: 14px;
    color: #b33f1d;
    margin-bottom: 6px;
}
.risk-alert-body {
    font-size: 13px;
    color: #5a321d;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-family: inherit;
}

/* ── 通知搜索 ── */
.notif-search {
    margin-bottom: 12px;
}
.notif-search input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d6dce5;
    border-radius: 6px;
    font-size: 14px;
}

/* ── 近期重难点项目 ── */
.key-project-section {
    background: #fff5f0;
    border: 2px solid #e8804a;
    border-left: 6px solid #d45d2a;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.key-project-header {
    font-weight: 700;
    font-size: 15px;
    color: #b33f1d;
    margin-bottom: 10px;
}
.key-project-card {
    background: #fff;
    border: 1px solid #f0c8b0;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.key-project-title {
    font-weight: 600;
    margin-bottom: 4px;
}
.key-project-title a { color: #2c5f8a; }
.key-project-risk {
    font-size: 13px;
    color: #5a321d;
    white-space: pre-wrap;
    line-height: 1.5;
}
.key-project-files {
    font-size: 12px;
    margin-top: 4px;
    color: #8492a6;
}
.key-project-files a {
    margin-right: 8px;
    color: #2c5f8a;
}

/* ── 风险附件 ── */
.risk-attachments {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0c8b0;
    font-size: 13px;
}
.att-link {
    display: inline-block;
    margin: 2px 6px;
    padding: 2px 8px;
    background: #ffedd5;
    border-radius: 4px;
    color: #9a3412;
    font-size: 12px;
}
.attachment-section {
    margin-top: 4px;
}
.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0f7ff;
    border: 1px solid #b8d4f0;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
}
.attachment-item a { color: #2c5f8a; }

/* ── 风险项独立区块 ── */
.risk-fieldset {
    border-color: #f0c8b0 !important;
    background: #fffdf9;
}
.risk-fieldset legend {
    color: #b33f1d !important;
}
.risk-att-upload {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fff5f0;
    border: 1px dashed #e8804a;
    border-radius: 6px;
}
.risk-att-header {
    font-size: 12px;
    font-weight: 600;
    color: #9a3412;
    margin-bottom: 6px;
}
.risk-att-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.risk-att-actions .att-file-input {
    font-size: 12px;
    max-width: 260px;
}
.risk-att-actions #attStatus {
    font-size: 12px;
    color: #8492a6;
}

/* ── 返回上一级 ── */
.back-nav {
    margin-bottom: 12px;
}
.btn-back {
    display: inline-block;
    color: #5a6d80;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
    transition: color 0.15s;
}
.btn-back:hover {
    color: #1f5fb0;
}

/* ── 右侧反馈按钮 ── */
.feedback-btn {
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    background: #1f6fe5;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px 0 0 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    writing-mode: vertical-rl;
    letter-spacing: 2px;
}
.feedback-btn:hover {
    background: #1557b8;
    right: 4px;
    box-shadow: -4px 2px 14px rgba(0,0,0,0.25);
}
.feedback-text {
    font-size: 13px;
}
@media (max-width: 640px) {
    .feedback-btn {
        padding: 8px 6px;
        font-size: 11px;
        right: 2px;
    }
    .feedback-text { font-size: 11px; }
}

/* ── AI 助手（常驻问答模块） ── */
.ai-fab {
    position: fixed;
    right: 18px;
    bottom: 30px;
    z-index: 900;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #3b82f6 100%);
    color: #fff;
    font-size: 34px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    animation: aiFabPulse 2.6s ease-in-out infinite;
}
@keyframes aiFabPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(99,102,241,0.45), 0 0 0 0 rgba(99,102,241,0.35); }
    50%      { box-shadow: 0 6px 24px rgba(99,102,241,0.45), 0 0 0 16px rgba(99,102,241,0); }
}
.ai-fab:hover {
    transform: scale(1.1);
}
.ai-panel {
    position: fixed;
    right: 18px;
    bottom: 112px;
    z-index: 901;
    width: 400px;
    max-width: calc(100vw - 28px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.30);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aiPanelIn 0.25s ease;
}
@keyframes aiPanelIn {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}
.ai-panel-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ai-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(4px);
}
.ai-header-text .ai-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}
.ai-header-text .ai-subtitle {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}
.ai-panel-close {
    background: rgba(255, 255, 255, 0.20);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.ai-panel-close:hover { background: rgba(255, 255, 255, 0.36); }
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background: #f6f7fb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: aiMsgIn 0.25s ease;
}
.ai-row-user {
    justify-content: flex-end;
}
@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.ai-bot-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 2px;
}
.ai-msg {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-msg-user {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.30);
}
.ai-msg-bot {
    background: #fff;
    color: #2c3e50;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.ai-msg-thinking {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 14px 16px;
}
.ai-msg-thinking .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    animation: aiDotBounce 1.2s infinite;
}
.ai-msg-thinking .dot:nth-child(2) { animation-delay: 0.15s; }
.ai-msg-thinking .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiDotBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%           { transform: translateY(-5px); opacity: 1; }
}
.ai-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 2px 0 4px;
}
.ai-quick-chips button {
    border: 1px solid #d8def8;
    background: #eef1fd;
    color: #4f5bd5;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.ai-quick-chips button:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}
.ai-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid #eef0f5;
    background: #fff;
    flex-shrink: 0;
    align-items: flex-end;
}
.ai-input-row textarea {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    max-height: 110px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.ai-input-row textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: #fbfbff;
}
.ai-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s, opacity 0.15s;
}
.ai-send-btn:hover { transform: scale(1.08); }
.ai-send-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
@media (max-width: 640px) {
    .ai-fab { right: 12px; bottom: 18px; width: 60px; height: 60px; font-size: 30px; }
    .ai-panel { right: 6px; bottom: 92px; height: 72vh; }
}

/* ── 标题行 ── */
.form-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.form-title-row h2 { margin: 0; flex: 1; }

/* ── 切换按钮（原型/派生） ── */
.toggle-group {
    display: inline-flex;
    border: 1px solid #d6dce5;
    border-radius: 6px;
    overflow: hidden;
}
.toggle-btn {
    padding: 5px 14px;
    border: none;
    background: #f7f8fa;
    color: #4a5568;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.toggle-btn:first-child { border-right: 1px solid #d6dce5; }
.toggle-btn.active {
    background: #3b82f6;
    color: #fff;
}
.toggle-btn:hover:not(.active) { background: #e8ecf2; }

/* ── 重难点项目大按钮 ── */
.key-toggle-btn {
    padding: 8px 18px;
    border: 2px solid #d6dce5;
    border-radius: 8px;
    background: #f7f8fa;
    color: #4a5568;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.key-toggle-btn:hover { background: #fee2e2; border-color: #fca5a5; }
/* 编辑页零件卡片 */
.part-edit-card {
    border: 1px solid #d6dce5;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: #fafbfc;
}
.part-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eef0f3;
}
.part-edit-header strong { font-size: 13px; color: #2c3e50; }

/* 组件零件卡片 */
.part-card {
    border: 1px solid #d6dce5;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fafbfc;
}
.part-card:last-child { margin-bottom: 0; }
.part-card-header {
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef0f3;
}
.part-card .detail-table { box-shadow: none; border-radius: 0; }
.part-card .detail-table th { background: #f4f6f9; width: 80px; font-size: 12px; }
.part-card .detail-table td { font-size: 13px; }

.key-toggle-btn.active {
    background: #ef4444;
    color: #fff;
    border-color: #dc2626;
}

/* ── 技术预研项目 ── */
.tech-preresearch-section {
    background: #f0f5ff;
    border: 2px solid #4d8ff7;
    border-left: 6px solid #1f6fe5;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 16px;
}
.tech-preresearch-header {
    font-weight: 700;
    font-size: 13px;
    color: #1f5fb0;
    margin-bottom: 8px;
}

/* 管理页分组 */
.tp-group-section {
    margin-bottom: 24px;
}
.tp-group-header {
    font-weight: 700;
    font-size: 15px;
    color: #1f5fb0;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #4d8ff7;
}
.tp-group-past {
    color: #8492a6;
    border-bottom-color: #b0bec5;
}

/* 卡片网格 */
.tech-preresearch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.tech-preresearch-card {
    background: #fff;
    border: 1px solid #b8d4f0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
}
.tech-preresearch-card:hover {
    box-shadow: 0 4px 14px rgba(31,111,229,0.15);
    transform: translateY(-2px);
    border-color: #1f6fe5;
}
.tech-preresearch-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef2f7;
    position: relative;
}
.tech-preresearch-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tech-preresearch-card-img-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #b0bec5;
}
.tech-preresearch-card-img-count {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
}
.tech-preresearch-card-info {
    padding: 6px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tech-preresearch-card-title {
    font-weight: 700;
    font-size: 11px;
    color: #2c3e50;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tech-preresearch-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #8492a6;
    margin-top: auto;
}
.tech-preresearch-card-meta .badge {
    font-size: 9px;
    padding: 1px 4px;
}

/* 详情页 */
.tp-detail-header {
    margin-bottom: 20px;
}
.tp-detail-header h1 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #2c3e50;
}
.tp-detail-meta-line {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #6b7785;
}
.tp-detail-block {
    margin-bottom: 16px;
}
.tp-detail-block:last-child { margin-bottom: 0; }
.tp-detail-label {
    font-weight: 700;
    font-size: 13px;
    color: #1f5fb0;
    margin-bottom: 4px;
}
.tp-detail-text {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 详情页图片网格 */
.tp-detail-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.tp-detail-image-card {
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
}
.tp-detail-image-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.tp-detail-image-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #eef2f7;
}
.tp-detail-image-name {
    padding: 8px 10px;
    font-size: 12px;
    color: #8492a6;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 预研项目表单图片网格 */
.tp-form-image-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}
.tp-form-image-card {
    width: 140px;
    border: 1px solid #d6dce5;
    border-radius: 6px;
    overflow: hidden;
    background: #fafbfc;
}
.tp-form-image-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    background: #eef0f3;
}
.tp-form-image-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 11px;
}
.tp-form-image-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8492a6;
}

/* 预研图预览 */
.tp-image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.tp-image-preview-overlay img {
    max-width: 70vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    background: #fff;
    padding: 4px;
}

@media (max-width: 640px) {
    .tech-preresearch-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .tech-preresearch-card-title { font-size: 13px; }
    .tech-preresearch-card-meta { font-size: 11px; }
    .tp-detail-image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
