/* ===== 简约风格基础 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px 15px;
    background-color: #f9fafb;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.5;
}

.container-fluid {
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    font-weight: 600;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: #111827;
}

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: #374151;
}

.card-body {
    padding: 1.25rem;
}

.form-control {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: border-color 0.15s;
    background: #fff;
    color: #1f2937;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

textarea.form-control {
    resize: vertical;
}

.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    line-height: 1.5;
    border-radius: 4px;
    transition: all 0.15s ease;
    background: #f3f4f6;
    color: #374151;
}

.btn:hover {
    background: #e5e7eb;
}

.btn-primary {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.btn-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-outline-success {
    background: transparent;
    border-color: #10b981;
    color: #10b981;
}

.btn-outline-success:hover {
    background: #10b981;
    color: #fff;
}

.btn-outline-warning {
    background: transparent;
    border-color: #f59e0b;
    color: #f59e0b;
}

.btn-outline-warning:hover {
    background: #f59e0b;
    color: #fff;
}

.btn-outline-info {
    background: transparent;
    border-color: #3b82f6;
    color: #3b82f6;
}

.btn-outline-info:hover {
    background: #3b82f6;
    color: #fff;
}

.btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* 表格容器：桌面端无水平滚动条 */
.table-responsive {
    overflow-x: auto;
}

@media (min-width: 992px) {
    .table-responsive {
        overflow-x: visible !important;
    }
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 0;
    table-layout: fixed;
}

.table th,
.table td {
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    text-align: center;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table thead th {
    background: #f9fafb;
    font-weight: 600;
    color: #4b5563;
    text-transform: none;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
    border-bottom: 2px solid #e5e7eb;
}

/* ===== 固定列宽（总宽720px） ===== */
.data-table th:nth-child(1),
.data-table td:nth-child(1) { width: 60px; }
.data-table th:nth-child(2),
.data-table td:nth-child(2) { width: 150px; }
.data-table th:nth-child(3),
.data-table td:nth-child(3) { width: 130px; }
.data-table th:nth-child(4),
.data-table td:nth-child(4) { width: 110px; }   /* 从 130px 调整为 110px */
.data-table th:nth-child(5),
.data-table td:nth-child(5) { width: 80px; }
.data-table th:nth-child(6),
.data-table td:nth-child(6) { width: 110px; }   /* 从 70px 增大为 110px */
.data-table th:nth-child(7),
.data-table td:nth-child(7) { width: 80px; }    /* 从 100px 调整为 80px */

/* 复制按钮 */
.copy-btn {
    color: #6366f1;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dashed #6366f1;
    transition: color 0.15s;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn:hover {
    color: #4f46e5;
    border-bottom-style: solid;
}

/* 图片管理入口 */
.img-manage {
    cursor: pointer;
    color: #10b981;
    font-weight: 500;
    transition: color 0.15s;
}

.img-manage:hover {
    color: #059669;
    text-decoration: underline;
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    display: block;
    min-height: 90px;
    user-select: none;
}

.upload-zone:hover,
.upload-zone:active {
    border-color: #6366f1;
    background-color: #f5f3ff;
}

.upload-zone i {
    font-size: 1.8rem;
    color: #9ca3af;
    margin-bottom: 4px;
}

.file-count {
    font-weight: 500;
    color: #6366f1;
    margin-top: 6px;
    font-size: 0.85rem;
}

/* 图片缩略图 */
.img-thumb-wrapper {
    display: inline-block;
    position: relative;
    margin: 4px;
}

.img-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    transition: border-color 0.15s;
}

.img-thumb:hover {
    border-color: #6366f1;
}

.delete-img-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0 4px;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    border-radius: 0 4px 0 4px;
    font-size: 0.8rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s;
}

.delete-img-btn:hover {
    background: #dc2626;
}

/* 加载占位 */
.loading-placeholder {
    text-align: center;
    padding: 30px 20px;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* 模态框 */
.modal-content {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.modal-header {
    border-bottom: 1px solid #f3f4f6;
    padding: 1rem 1.25rem;
}

.modal-footer {
    border-top: 1px solid #f3f4f6;
    padding: 0.75rem 1.25rem;
}

.text-muted {
    color: #6b7280 !important;
}

.section-title {
    margin: 24px 0 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

/* 复制成功提示 */
.copy-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.copy-toast.show {
    opacity: 1;
}

/* ===== 移动端优化：表格正常显示，全部列可见 ===== */
@media (max-width: 768px) {
    body {
        padding: 10px 8px;
    }

    .toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .toolbar .btn {
        flex: 1 1 auto;
        min-width: 70px;
        padding: 0.5rem 0.4rem;
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    /* 保持表格布局，不允许横向滚动 */
    .table-responsive {
        overflow-x: visible !important;
    }

    .data-table {
        table-layout: auto !important;      /* 自动分配列宽 */
    }

    .data-table th,
    .data-table td {
        width: auto !important;             /* 移除固定列宽 */
        padding: 0.4rem 0.2rem;
        font-size: 0.7rem;
        white-space: nowrap;                /* 保持单行，过长截断 */
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .data-table thead th {
        font-size: 0.65rem;
        white-space: nowrap;
    }

    /* 复制按钮适配 */
    .copy-btn {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 按钮再缩小 */
    .btn-sm {
        padding: 0.15rem 0.35rem;
        font-size: 0.65rem;
    }

    .btn {
        font-size: 0.7rem;
    }

    /* 导出列按钮不换行 */
    .export-btn,
    .crop-export-btn {
        white-space: nowrap;
    }
}