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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
}

/* 整体布局 */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* 左侧边栏 */
.sidebar {
    width: 280px;
    background: #ffffff;
    color: #1a1a2e;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    background: #1a1a2e;
    margin: -20px -20px 20px -20px;
    padding: 20px;
}

.sidebar-logo {
    max-width: 200px;
    height: auto;
    filter: brightness(0) invert(1);
}

/* 浮动管理员按钮 - 固定右上角 */
.admin-float-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1a1a2e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s;
    user-select: none;
}

.admin-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.admin-float-btn .admin-icon {
    font-size: 20px;
}

.admin-float-btn.admin-active {
    background: #10b981;
}

/* 管理员专属功能 - 默认隐藏 */
.admin-only {
    display: none;
}

body.admin-mode .admin-only {
    display: inline-block;
}

.payment-schedule {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.payment-schedule h4 {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 10px;
}

.schedule-dates {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.schedule-date-item {
    font-size: 18px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s;
}

.schedule-date-item.active {
    color: #ca8a04;
    background: #fef9c3;
}

.schedule-date-item.expired {
    color: #9ca3af;
    background: #f3f4f6;
    text-decoration: line-through;
    text-decoration-color: #d1d5db;
}

.schedule-note {
    font-size: 11px;
    color: #9ca3af;
}

.project-summary h4 {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
    text-align: center;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    border-left: 3px solid #f59e0b;
}

.summary-item.completed {
    border-left-color: #10b981;
    opacity: 0.7;
}

/* 统计面板 */
.stats-panel {
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    margin-top: 20px;
}

.stats-panel h4 {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    text-align: center;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.25s;
    cursor: pointer;
}

.stat-item:hover {
    background: #f8fafc;
    transform: translateX(3px);
    border-color: #cbd5e1;
}

.stat-item.active {
    background: #eff6ff;
    border-color: #3b82f6;
}

.stat-item.stat-total-item {
    cursor: default;
}

.stat-item.stat-total-item:hover {
    transform: none;
    border-color: #e2e8f0;
    background: #f8fafc;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-item .stat-label {
    font-size: 12px;
    color: #475569;
}

.stat-item .stat-value {
    font-size: 16px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
}

.stat-value.stat-filing { color: #9333ea; background: #f3e8ff; }
.stat-value.stat-voucher { color: #2563eb; background: #dbeafe; }
.stat-value.stat-payment { color: #7c3aed; background: #ede9fe; }
.stat-value.stat-done { color: #059669; background: #d1fae5; }

.stat-total-item {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 6px;
    padding: 8px 10px;
}

.stat-total-item .stat-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}

.stat-total-item .stat-value {
    font-size: 18px;
    color: #1a1a2e;
    background: #e2e8f0;
}

.summary-title {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-desc {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 30px 0 20px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.subtitle {
    color: #64748b;
    font-size: 14px;
}

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-box {
    flex: 1;
    min-width: 180px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.25s;
    background: #f8fafc;
}

.search-box input:focus {
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-box select {
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #f8fafc;
    cursor: pointer;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: white;
    border-radius: 16px;
    padding: 22px 26px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border-left: 5px solid #e2e8f0;
    transition: all 0.3s;
}

.order-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.order-card.status-collecting { border-left-color: #f59e0b; }
.order-card.status-filing { border-left-color: #a855f7; }
.order-card.status-voucher { border-left-color: #3b82f6; }
.order-card.status-payment { border-left-color: #8b5cf6; }
.order-card.status-done { border-left-color: #10b981; }

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.order-info h3 {
    font-size: 17px;
    color: #0f172a;
    margin-bottom: 4px;
    font-weight: 600;
}

.order-no {
    font-size: 12px;
    color: #94a3b8;
    font-family: monospace;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-collecting .status-badge { background: #fef3c7; color: #b45309; }
.status-filing .status-badge { background: #f3e8ff; color: #7c3aed; }
.status-voucher .status-badge { background: #dbeafe; color: #1d4ed8; }
.status-payment .status-badge { background: #ede9fe; color: #6d28d9; }
.status-done .status-badge { background: #dcfce7; color: #15803d; }

.order-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meta-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 15px;
    color: #334155;
    font-weight: 600;
}

.meta-value.amount {
    color: #dc2626;
    font-weight: 700;
    font-size: 18px;
}

.meta-value.warning { color: #d97706; font-weight: 700; }
.meta-value.danger { color: #dc2626; font-weight: 700; }

.timeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
    padding: 8px 0;
    overflow-x: auto;
}

.timeline-step {
    flex: 1;
    min-width: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.timeline-step.done:not(:last-child)::after {
    background: #10b981;
}

.timeline-step.current:not(:last-child)::after {
    background: linear-gradient(90deg, #10b981 50%, #e2e8f0 50%);
}

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    z-index: 1;
    margin-bottom: 4px;
}

.timeline-step.done .timeline-dot {
    background: #10b981;
    color: white;
}

.timeline-step.current .timeline-dot {
    background: #3b82f6;
    color: white;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

.timeline-label {
    font-size: 10px;
    color: #64748b;
    text-align: center;
    font-weight: 500;
}

.timeline-step.done .timeline-label { color: #15803d; }
.timeline-step.current .timeline-label { color: #1d4ed8; }

.timeline-operator {
    font-size: 9px;
    color: #94a3b8;
    margin-top: 2px;
    text-align: center;
}

.timeline-time {
    font-size: 8px;
    color: #cbd5e1;
    margin-top: 1px;
}

.order-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 14px;
    opacity: 0.5;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

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

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
    font-size: 17px;
    color: #0f172a;
    font-weight: 600;
}

.close {
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    line-height: 1;
}

.close:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.modal-body {
    padding: 20px 22px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 22px;
    border-top: 1px solid #f1f5f9;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: #475569;
    margin-bottom: 6px;
    font-weight: 500;
}

.required {
    color: #dc2626;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.25s;
    background: #f8fafc;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

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

.form-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 18px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.form-section-title:first-child {
    margin-top: 0;
}

.input-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.amount-display {
    font-size: 18px;
    font-weight: 700;
    color: #dc2626;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 8px;
    text-align: center;
    margin-top: 6px;
}

/* 项目信息卡片 */
.project-info-display {
    margin-bottom: 14px;
}

.info-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px;
    border: 1px solid #e2e8f0;
}

.info-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #64748b;
    flex-shrink: 0;
}

.info-value {
    color: #1e293b;
    font-weight: 500;
}

/* 资料勾选 */
.required-docs {
    margin-bottom: 14px;
}

.required-docs h5 {
    font-size: 12px;
    color: #475569;
    margin-bottom: 10px;
    font-weight: 600;
}

.doc-checklist {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.doc-item:hover {
    background: #f1f5f9;
}

.doc-item.checked {
    background: #dcfce7;
    border-color: #10b981;
}

.doc-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #10b981;
    cursor: pointer;
}

.doc-item.business-doc {
    background: #fef3c7;
    border: 1px dashed #d97706;
}

.doc-item.business-doc::after {
    content: '(业务助理做)';
    font-size: 10px;
    color: #b45309;
    margin-left: 4px;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-bottom: 14px;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.upload-area.has-files {
    border-style: solid;
    border-color: #10b981;
    background: #f0fdf4;
}

.upload-placeholder {
    cursor: pointer;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 13px;
    color: #475569;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 11px;
    color: #94a3b8;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.upload-file {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.upload-file img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-file .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-file .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        margin-left: 240px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .doc-checklist {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .toolbar {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
}
