/* 常购器材/项目列表等页面共用 */
.container {
    padding: 32px 20px 24px;
}

.nav-bar {
    background: rgba(255, 255, 255, 0.82);
    padding: 10px 16px;
    border-radius: var(--radius-md, 14px);
    margin-bottom: 18px;
    box-shadow: var(--shadow-nav, 0 2px 12px rgba(0, 0, 0, 0.04));
    border: 1px solid rgba(110, 130, 200, 0.22);
    backdrop-filter: blur(8px);
}

.nav-bar a {
    color: var(--color-link, #5b7cbd);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.add-form {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.add-btn {
    background: var(--primary-gradient-btn, linear-gradient(135deg, #6b9eff, #7c6eff));
    color: white;
    border: none;
    padding: 12px 26px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(107, 158, 255, 0.28);
    transition: all 0.18s ease;
}

.add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(107, 158, 255, 0.35);
}

.form-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-mask-bg, linear-gradient(165deg, rgba(32, 42, 58, 0.45) 0%, rgba(22, 32, 48, 0.55) 100%));
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
    z-index: 10100;
    display: none;
    justify-content: center;
    align-items: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.form-content {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(252, 253, 255, 0.98) 100%);
    padding: 0;
    border-radius: var(--radius-lg, 24px);
    box-shadow: var(--shadow-modal, 0 24px 56px rgba(30, 40, 62, 0.16)), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    width: min(520px, 100%);
    max-width: 520px;
    border: 1px solid rgba(110, 130, 200, 0.24);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    position: relative;
}
.form-content::before {
    content: "";
    display: block;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, #8eb0ff 0%, #9b94f0 50%, #a89eff 100%);
    opacity: 0.92;
}
.form-content > * {
    padding-left: 26px;
    padding-right: 26px;
}
.form-content > h2 {
    padding-top: 22px;
    padding-bottom: 0;
    margin-bottom: 14px;
    color: var(--color-text, #2c3e4f);
    font-size: 1.1rem;
    font-weight: 600;
}
.form-content > form {
    padding-bottom: 22px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.86rem;
    color: var(--color-text-muted, #5b6e8c);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid rgba(110, 130, 200, 0.3);
    border-radius: 12px;
    background-color: #fff;
    color: var(--color-text, #2c3e4f);
    font-size: 0.9rem;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #7c6eff;
    box-shadow: 0 0 0 3px rgba(124, 110, 255, 0.15);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 18px;
}

.form-actions button {
    padding: 9px 20px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-submit {
    background: var(--primary-gradient-btn, linear-gradient(135deg, #6b9eff, #7c6eff));
    color: white;
    border: none;
}

.btn-cancel {
    background-color: rgba(110, 130, 200, 0.12);
    color: var(--color-text, #2c3e4f);
    border: 1px solid rgba(110, 130, 200, 0.35);
}

.equipment-list {
    padding: 20px 20px 18px;
}

.equipment-list h2 {
    margin-bottom: 14px;
    color: var(--color-text, #2c3e4f);
    font-size: 1rem;
}

.equipment-search-input {
    display: block;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(110, 130, 200, 0.3);
    background: #fff;
    color: var(--color-text, #2c3e4f);
    font-size: 0.9rem;
    min-width: 200px;
    max-width: 320px;
}

.equipment-search-input::placeholder {
    color: var(--color-text-muted, #5b6e8c);
}

.equipment-search-input:hover {
    border-color: rgba(124, 110, 255, 0.45);
}

.equipment-search-input:focus {
    border-color: #7c6eff;
    box-shadow: 0 0 0 3px rgba(124, 110, 255, 0.15);
    outline: none;
}

.project-link {
    color: var(--color-link, #5b7cbd);
    text-decoration: none;
}

.project-link:hover {
    text-decoration: underline;
}

.detail-section {
    padding: 18px 20px;
    margin-bottom: 18px;
}

.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.detail-section h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text, #2c3e4f);
}

.detail-section-tip {
    margin: 4px 0 10px;
    font-size: 0.82rem;
    color: var(--color-text-muted, #5b6e8c);
}

.detail-basic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 16px;
    font-size: 0.86rem;
    color: var(--color-text, #2c3e4f);
}

.detail-date-item {
    grid-column: span 1;
}

.detail-status-flag {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--color-text-muted, #5b6e8c);
}

.detail-status-flag.status-done {
    color: #2a9d6a;
}

.detail-textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(110, 130, 200, 0.3);
    background-color: #fff;
    color: var(--color-text, #2c3e4f);
    padding: 8px 10px;
    font-size: 0.85rem;
    resize: vertical;
}

.detail-material-form .form-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.detail-material-form input {
    flex: 1;
}

.detail-subrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--color-text, #2c3e4f);
}

/* 图片行：标签与保存按钮与输入框垂直居中，保存与完成同列 */
.detail-subrow .btn-save {
    margin-left: auto;
}

.detail-img-input {
    flex: 1;
}

.detail-img-textarea {
    flex: 1;
    min-width: 200px;
    resize: vertical;
    font-family: inherit;
}

.detail-image-preview {
    margin-top: 8px;
    min-height: 40px;
}

.detail-image-preview img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 10px;
    border: 1px solid rgba(103, 132, 255, 0.4);
}

.detail-image-preview-multi {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.detail-image-preview-multi .detail-img-item {
    position: relative;
    flex: 0 1 200px;
    max-width: 280px;
    min-height: 120px;
    border-radius: 10px;
    border: 1px solid rgba(110, 130, 200, 0.25);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.6);
}

.detail-image-preview-multi .detail-img-item img {
    display: block;
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    /* 预留高度减少懒加载时的布局偏移 */
    min-height: 120px;
}

.detail-img-zoomable {
    cursor: pointer;
}

/* 双击图片放大：全屏遮罩 */
.image-zoom-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.image-zoom-overlay.image-zoom-open {
    visibility: visible;
    opacity: 1;
}
.image-zoom-overlay .image-zoom-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 24, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: zoom-out;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-zoom-overlay .image-zoom-img {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
    pointer-events: none;
}
.image-zoom-overlay .image-zoom-hint {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.detail-img-item-fail {
    display: block;
    padding: 8px;
    font-size: 0.8rem;
}

.detail-img-item .btn-replace-img {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: #6ec1f7;
    background: rgba(10, 15, 30, 0.85);
    border: 1px solid rgba(77, 163, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
}
.detail-img-item .btn-replace-img:hover {
    color: #fff;
    background: rgba(77, 163, 255, 0.35);
    border-color: #4da3ff;
}

.detail-img-empty {
    font-size: 0.8rem;
    color: #808bb0;
}

/* 确认弹窗样式已移至 base.css，此处仅保留常购器材页特有内容 */

.confirm-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 全局 Toast：顶部居中，避免被遮挡，z-index 高于弹窗 */
.global-toast-wrap {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.global-toast-wrap-top {
    top: max(1rem, calc(env(safe-area-inset-top, 0px) + 0.5rem));
    justify-content: flex-start;
}
.global-toast {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px 13px 18px;
    font-size: 0.9rem;
    line-height: 1.45;
    max-width: min(92vw, 28rem);
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    transition: opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1), transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 10px 36px rgba(25, 35, 55, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.global-toast-icon {
    flex-shrink: 0;
    font-weight: bold;
}
.global-toast-text {
    flex: 1;
}
.global-toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
/* Toast 类型色由 base.css 的 .global-toast-* 统一 */

/* 表格加载骨架屏：给 tbody 加 class table-skeleton 时显示 */
.table-skeleton td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(110, 130, 200, 0.15);
}
.table-skeleton td::after {
    content: "";
    display: block;
    height: 14px;
    max-width: 80%;
    background: linear-gradient(90deg, rgba(124, 110, 255, 0.12) 25%, rgba(124, 110, 255, 0.05) 50%, rgba(124, 110, 255, 0.12) 75%);
    background-size: 200% 100%;
    animation: table-skeleton-shine 1.2s ease-in-out infinite;
    border-radius: 4px;
}
@keyframes table-skeleton-shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(110, 130, 200, 0.18);
    font-size: 0.87rem;
    color: var(--color-text, #2c3e4f);
}

#projectTable {
    table-layout: fixed;
}

#projectTable th:nth-child(8),
#projectTable td:nth-child(8) {
    max-width: 220px;
}

.remark-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remark-tooltip {
    position: fixed;
    z-index: 6000;
    max-width: 320px;
    max-height: 60vh;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--color-text, #2c3e4f);
    font-size: 0.82rem;
    line-height: 1.4;
    border: 1px solid rgba(110, 130, 200, 0.28);
    box-shadow: var(--shadow-card, 0 12px 32px rgba(0, 0, 0, 0.08));
    pointer-events: none;
    opacity: 0;
    overflow-y: auto;
}

#projectTable th:nth-child(9),
#projectTable td:nth-child(9) {
    text-align: center;
    white-space: nowrap;
}

th {
    background: rgba(124, 110, 255, 0.06);
    font-weight: 600;
    color: #2c5a8c;
    border-bottom: 1px solid rgba(110, 130, 200, 0.22);
}

tr:hover {
    background-color: rgba(124, 110, 255, 0.04);
}

.message {
    padding: 8px 10px;
    margin-bottom: 16px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.success {
    background-color: rgba(42, 157, 106, 0.1);
    color: #1f7a52;
    border: 1px solid rgba(42, 157, 106, 0.35);
}

.error {
    background-color: rgba(220, 53, 69, 0.08);
    color: #b83240;
    border: 1px solid rgba(220, 53, 69, 0.35);
}

.toast-msg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: var(--shadow-card, 0 12px 32px rgba(0, 0, 0, 0.08));
    transition: opacity 0.2s;
    max-width: 90%;
    background: rgba(255, 255, 255, 0.96);
    color: var(--color-text, #2c3e4f);
    border: 1px solid rgba(110, 130, 200, 0.22);
}

.toast-msg:empty {
    display: none;
}

.toast-msg.success {
    background: rgba(40, 167, 69, 0.95);
    color: #fff;
    border: 1px solid rgba(40, 167, 69, 0.6);
}

.toast-msg.error {
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    border: 1px solid rgba(220, 53, 69, 0.6);
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-view {
    color: #1f8a5c;
    border-color: rgba(42, 157, 106, 0.45);
    background: rgba(42, 157, 106, 0.08);
    text-decoration: none;
}

.btn-view:hover {
    background: rgba(42, 157, 106, 0.14);
    border-color: rgba(42, 157, 106, 0.55);
}

.btn-edit {
    color: #3d6ab8;
    border-color: rgba(91, 124, 189, 0.45);
    background: rgba(110, 130, 200, 0.06);
}

.btn-delete {
    margin-left: 6px;
    color: #c74a3a;
    border-color: rgba(255, 138, 122, 0.45);
    background: rgba(255, 138, 122, 0.08);
}

.btn-complete {
    margin-left: 6px;
    color: #1f8a5c;
    border-color: rgba(42, 157, 106, 0.45);
    background: rgba(42, 157, 106, 0.08);
    font-weight: 600;
}

@media (max-width: 768px) {
    .container {
        padding: 20px 14px 18px;
    }
    header {
        padding: 20px 18px;
        border-radius: 14px;
    }
    .equipment-list {
        padding: 16px 14px 14px;
        border-radius: 14px;
    }
    th, td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
}

/* 常购器材页 purchase.html 布局与导航（原内联样式） */
#authGuard { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(246, 249, 252, 0.92); z-index: 9999; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted, #5b6e8c); font-size: 1rem; backdrop-filter: blur(6px); }
#pageContent { display: none; }
.nav-bar-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-link { color: var(--color-link, #5b7cbd); text-decoration: none; padding: 6px 12px; border-radius: 10px; border: 1px solid rgba(110,130,200,0.35); background: rgba(255,255,255,0.75); font-size: 0.9rem; }
.nav-link:hover { color: #2c5a8c; background: rgba(124,110,255,0.1); border-color: rgba(124,110,255,0.45); }
.nav-account { color: var(--color-text, #2c3e4f); padding: 0 4px; }
.nav-logout { padding: 6px 12px; border-radius: 40px; border: 1px solid rgba(255,138,122,0.45); background: rgba(255,138,122,0.1); color: #c74a3a; cursor: pointer; font-size: 0.9rem; }
.nav-logout:hover { background: rgba(255,138,122,0.18); }
.global-top-right { 
    position: fixed; 
    top: 0; 
    right: 0; 
    z-index: 9998; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 12px 20px; 
    background: var(--color-bg-nav, rgba(255, 255, 255, 0.88)); 
    border-bottom-left-radius: 16px; 
    box-shadow: var(--shadow-nav, 0 2px 12px rgba(0, 0, 0, 0.04));
    backdrop-filter: blur(12px);
}
.global-top-right a { 
    color: var(--color-link, #5b7cbd); 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 500;
    padding: 8px 16px; 
    border-radius: 10px; 
    border: 1px solid rgba(110,130,200,0.35); 
    background: var(--primary-gradient-nav, linear-gradient(135deg, rgba(107, 158, 255, 0.12) 0%, rgba(124, 110, 255, 0.1) 100%));
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.global-top-right a:hover { 
    color: #2c5a8c; 
    background: var(--primary-gradient-nav-hover, linear-gradient(135deg, rgba(107, 158, 255, 0.22) 0%, rgba(124, 110, 255, 0.18) 100%)); 
    border-color: rgba(124,110,255,0.45); 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 158, 255, 0.15);
}
.global-top-right .gt-account { 
    color: var(--color-text, #2c3e4f); 
    padding: 0 8px; 
    font-weight: 500;
    font-size: 0.95rem;
}
.global-top-right .gt-logout { 
    padding: 8px 16px; 
    border-radius: 40px; 
    border: 1px solid rgba(255,138,122,0.45); 
    background: rgba(255,138,122,0.1);
    color: #c74a3a; 
    cursor: pointer; 
    font-size: 0.9rem; 
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.global-top-right .gt-logout:hover { 
    background: rgba(255,138,122,0.18);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,138,122,0.15);
    color: #c74a3a;
}

/* ===== 布局精修：区块位置与响应式 ===== */
.container {
    max-width: var(--layout-max-width, 78rem);
}

.content {
    gap: 14px;
}

.detail-section,
.equipment-list {
    padding: 18px;
}

.detail-section-header {
    flex-wrap: wrap;
}

.detail-material-form .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px auto auto;
    gap: 10px;
    align-items: center;
}

.detail-subrow {
    flex-wrap: wrap;
}

.detail-subrow > label {
    min-width: 56px;
}

.detail-img-textarea,
.detail-input-url {
    width: 100%;
}

@media (max-width: 980px) {
    .detail-material-form .form-row {
        grid-template-columns: minmax(0, 1fr) 100px;
    }
    .detail-material-form .form-row .btn-pick-equipment,
    .detail-material-form .form-row .btn-submit {
        grid-column: span 1;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .detail-section,
    .equipment-list {
        padding: 14px;
    }
    .detail-subrow > label {
        min-width: auto;
        width: 100%;
        margin-bottom: 2px;
    }
    .detail-img-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}
