* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 24px;
    color: #333;
}

.auth-panel {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    width: min(420px, 100%);
    padding: 34px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.auth-card h1 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 24px;
}

.auth-subtitle {
    margin-bottom: 24px;
    color: #6c757d;
}

.auth-card label {
    display: block;
    margin: 14px 0 6px;
    color: #495057;
    font-weight: 600;
}

.auth-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
}

.auth-submit {
    width: 100%;
    margin-top: 18px;
}

.auth-message {
    min-height: 22px;
    margin-top: 16px;
    color: #198754;
    font-size: 14px;
    line-height: 1.5;
}

.auth-message.error,
.sync-status.error {
    color: #dc3545;
}

.auth-local-link {
    display: block;
    margin: 14px auto 0;
    border: 0;
    background: transparent;
    color: #667eea;
    cursor: pointer;
    font-size: 13px;
}

.app-locked {
    visibility: hidden;
}

.sync-status {
    max-width: 280px;
    overflow: hidden;
    color: rgba(255, 255, 255, .9);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-modal-content {
    max-width: 760px;
}

.permission-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 0;
}

.permission-checks label {
    color: #495057;
    font-size: 14px;
}

.member-list {
    margin-top: 24px;
    border-top: 1px solid #e9ecef;
}

.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f5;
    font-size: 14px;
}

.member-row small {
    display: block;
    margin-top: 4px;
    color: #6c757d;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-bar {
    padding: 24px 40px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.filter-bar input,
.filter-bar select {
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    background: white;
}

.filter-bar input {
    flex: 1;
    max-width: 450px;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.table-container {
    overflow-x: auto;
    padding: 24px 40px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

thead {
    background: linear-gradient(to bottom, #f8f9fa 0%, #f0f2f5 100%);
}

th {
    padding: 16px 18px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 3px solid #dee2e6;
    white-space: nowrap;
    font-size: 14px;
    letter-spacing: 0.3px;
}

td {
    padding: 18px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.001);
    transition: all 0.2s;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 8px 16px;
    font-size: 13px;
    margin: 0 4px;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-edit {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    padding: 8px 16px;
    font-size: 13px;
    margin: 0 4px;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-view {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    padding: 8px 16px;
    font-size: 13px;
    margin: 0 4px;
}

.btn-view:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 40px auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 850px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

.modal-content.large {
    max-width: 1300px;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 32px 40px;
}

.modal-footer {
    padding: 24px 32px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid #e9ecef;
}

/* 表单样式 */
.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e9ecef;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: #667eea;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
    display: inline-block;
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group .required {
    color: #dc3545;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
}

/* 表单数组容器样式 */
.form-array-container {
    margin-top: 16px;
}

.form-array-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.form-array-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.form-array-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #dee2e6;
}

.form-array-item-header h4 {
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

/* 标签页样式 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 详情页样式 */
.detail-section {
    margin-bottom: 32px;
}

.detail-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
    border-bottom: 3px solid #667eea;
    display: inline-block;
    width: 100%;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-item {
    padding: 18px 20px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.detail-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.detail-item label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.detail-item .value {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.5;
}

/* 变更签证和进度表格 */
.change-section,
.progress-section {
    margin-top: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    color: #667eea;
    margin: 0;
}

.change-table,
.progress-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.change-table th,
.progress-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.change-table td,
.progress-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.change-table tbody tr:hover,
.progress-table tbody tr:hover {
    background: #f8f9fa;
}

.section-description {
    color: #6c757d;
    font-size: 13px;
    margin-top: 6px;
}

.section-header.compact {
    margin-bottom: 12px;
}

.audit-query-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: -4px 0 14px;
    padding: 12px;
    background: #f8f9fc;
    border: 1px solid #e6e9f2;
    border-radius: 8px;
}

.audit-query-bar input,
.audit-query-bar select {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #d9deea;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
}

.audit-query-bar input {
    flex: 1;
    min-width: 240px;
}

.query-result-count {
    margin-left: auto;
    color: #6c757d;
    font-size: 13px;
    white-space: nowrap;
}

.four-columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.table-scroll {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.value-audit-table,
.cost-audit-table {
    min-width: 1050px;
    width: 100%;
    border-collapse: collapse;
}

.value-audit-table th,
.cost-audit-table th {
    background: #f3f5fb;
    padding: 11px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.value-audit-table td,
.cost-audit-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #edf0f5;
    font-size: 12px;
    white-space: nowrap;
}

.route-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.physical-progress-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafbff;
}

.physical-progress-grid {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1.5fr 1.5fr auto;
    gap: 10px;
    align-items: start;
}

.physical-progress-grid input,
.physical-progress-grid textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #dfe3eb;
    border-radius: 6px;
    font-size: 12px;
    resize: vertical;
}

.calculation-message {
    min-height: 20px;
    margin: -4px 0 14px;
    font-size: 13px;
}

.success-text {
    color: #198754;
}

.warning-text {
    color: #b45309;
}

.audit-rule-card {
    display: grid;
    gap: 8px;
    margin: 14px 0 18px;
    padding: 14px 16px;
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    color: #39445c;
    font-size: 13px;
    line-height: 1.6;
}

.empty-message {
    text-align: center;
    padding: 28px !important;
    color: #6c757d;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px auto;
    }

    header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .table-container {
        padding: 10px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    .physical-progress-grid {
        grid-template-columns: 1fr;
    }
}

/* 数字格式化 */
.number {
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.info-text {
    margin-left: 5px;
    font-size: 14px;
    cursor: help;
}

/* 可展开表格样式 */
.expand-cell {
    text-align: center;
    padding: 12px !important;
}

.expand-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.expand-icon {
    display: inline-block;
    transition: transform 0.3s;
    font-weight: bold;
}

.project-main-row {
    cursor: pointer;
    transition: all 0.2s;
}

.project-main-row:hover {
    background: linear-gradient(to right, #f8f9fa 0%, #f0f2f5 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.project-details-row {
    background: #f8f9fa;
}

.project-details-row td {
    padding: 0 !important;
    border-top: none;
}

.details-container {
    padding: 28px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    margin: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.details-section {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.details-category {
    border-left: 5px solid #667eea;
    padding-left: 20px;
    padding-bottom: 20px;
    padding-top: 8px;
    border-bottom: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.details-category:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.details-category:last-child {
    border-bottom: none;
}

.details-category h4 {
    color: #667eea;
    margin-bottom: 18px;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.5px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.details-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.details-table thead {
    background: linear-gradient(to bottom, #f8f9fa 0%, #f0f2f5 100%);
}

.details-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    color: #2c3e50;
    border-bottom: 3px solid #dee2e6;
    letter-spacing: 0.3px;
}

.details-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.details-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.001);
    transition: all 0.2s;
}

.empty-message {
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.category-cell {
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    padding: 12px !important;
}

.category-cell:hover {
    background: linear-gradient(to right, #f0f4ff 0%, #e8f0ff 100%);
    border-radius: 8px;
    transform: scale(1.02);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.category-title {
    font-weight: 700;
    color: #667eea;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.category-icon {
    font-size: 10px;
    color: #667eea;
    transition: transform 0.3s;
}

.category-summary {
    font-size: 12px;
    color: #495057;
    line-height: 1.5;
    font-weight: 500;
}

@keyframes highlight {
    0% { background-color: transparent; }
    50% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}
