/* 借款记账管理系统 - 纵向甘特图样式 */

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

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

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

/* 头部样式 */
.header {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    padding: 25px 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
}

.storage-indicator {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    backdrop-filter: blur(10px);
}

/* 概览面板 */
.summary-panel {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

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

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 4px solid #007bff;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.summary-card.urgent { border-left-color: #dc3545; }
.summary-card.warning { border-left-color: #ffc107; }
.summary-card.success { border-left-color: #28a745; }
.summary-card.info { border-left-color: #17a2b8; }

.summary-card h3 {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.summary-card .amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.summary-card .detail {
    font-size: 0.8rem;
    color: #6c757d;
}

/* 主要内容区 */
.main-content {
    padding: 25px;
}

/* 控制面板 */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 15px;
}

.view-controls {
    display: flex;
    gap: 10px;
}

.filter-panel {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* 甘特图容器 */
.gantt-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 25px;
}

.gantt-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.gantt-header h2 {
    color: #495057;
    font-size: 1.4rem;
    margin: 0;
}

.legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.legend-item.paid { color: #28a745; }
.legend-item.current { color: #fd7e14; }
.legend-item.due { color: #6c757d; }
.legend-item.overdue { color: #dc3545; }
.legend-item.completed { color: #17a2b8; }

/* 甘特图主体 */
.gantt-chart {
    position: relative;
    overflow: auto;
    max-height: 70vh;
    border: 1px solid #e9ecef;
}

/* 平台头部 */
.gantt-platforms {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-bottom: 2px solid #495057;
}

.time-column-header {
    width: 120px;
    min-width: 120px;
    padding: 15px 10px;
    font-weight: 600;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.1);
}

.platform-column {
    min-width: 150px;
    max-width: 200px;
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,0.2);
    position: relative;
    font-size: 0.9rem;
}

.platform-column .platform-name {
    display: block;
    margin-bottom: 5px;
}

.platform-column .platform-info {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* 甘特图内容区 */
.gantt-content {
    background: white;
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
}

.gantt-row:hover {
    background: #f8f9fa;
}

.gantt-row.today {
    background: linear-gradient(90deg, #fff3cd, #ffffff);
    border-color: #ffc107;
}

/* 时间列 */
.time-cell {
    width: 120px;
    min-width: 120px;
    padding: 12px 10px;
    border-right: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 10;
}

.time-cell.today {
    background: linear-gradient(45deg, #ffc107, #fd7e14);
    color: white;
    font-weight: 600;
}

.time-date {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.time-month {
    font-size: 0.75rem;
    color: #6c757d;
}

.time-cell.today .time-month {
    color: rgba(255,255,255,0.9);
}

/* 还款单元格 */
.payment-cell {
    min-width: 150px;
    max-width: 200px;
    flex: 1;
    padding: 8px;
    border-right: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.payment-item {
    width: 100%;
    height: 35px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.payment-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 20;
}

.payment-item.paid {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.payment-item.current {
    background: linear-gradient(135deg, #fd7e14, #ffc107);
    animation: pulse 2s infinite;
}

.payment-item.due {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
}

.payment-item.overdue {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    animation: blink 1s infinite alternate;
}

.payment-item.completed {
    background: linear-gradient(135deg, #17a2b8, #20c997);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes blink {
    0% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* 还款金额显示 */
.payment-amount {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 工具提示 */
.payment-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    margin-bottom: 5px;
}

.payment-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
}

.payment-item:hover .payment-tooltip {
    opacity: 1;
}

/* 快速还款面板 */
.quick-payment-panel {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.quick-payment-panel h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.payment-form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.payment-form-inline select,
.payment-form-inline input {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    min-width: 150px;
}

.payment-form-inline select:focus,
.payment-form-inline input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #545b62);
    color: white;
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.modal-header h2 {
    margin: 0;
    color: #495057;
    font-size: 1.3rem;
}

.close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 25px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 加载指示器 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .platform-column,
    .payment-cell {
        min-width: 120px;
    }
    
    .payment-item {
        height: 30px;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 5px;
        border-radius: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .storage-indicator {
        position: static;
        margin-top: 10px;
        display: inline-block;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-controls {
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .filter-panel {
        justify-content: center;
    }
    
    .gantt-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .legend {
        justify-content: center;
    }
    
    .time-column-header,
    .time-cell {
        width: 100px;
        min-width: 100px;
    }
    
    .platform-column,
    .payment-cell {
        min-width: 100px;
        max-width: 120px;
    }
    
    .payment-item {
        height: 25px;
        font-size: 0.65rem;
    }
    
    .platform-column {
        font-size: 0.8rem;
        padding: 10px 5px;
    }
    
    .payment-form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .payment-form-inline select,
    .payment-form-inline input {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}
/* 甘特图加载状态样式 */
.gantt-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.loading-gantt-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.spinner-gantt {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-gantt-content h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.loading-gantt-content p {
    color: #6c757d;
    margin-bottom: 25px;
}

.loading-progress {
    width: 100%;
}

.progress-bar-loading {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill-loading {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.loading-status {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* 甘特图错误状态样式 */
.gantt-error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, #fff5f5, #ffffff);
}

.error-gantt-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.error-gantt-content h3 {
    color: #dc3545;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.error-message {
    color: #6c757d;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.error-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
