/* 交叉分析樣式 */

.cross-container {
    max-width: 950px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Microsoft JhengHei', 'PingFang TC', sans-serif;
}

.cross-header {
    text-align: center;
    margin-bottom: 30px;
}

.cross-header h1 {
    font-size: 2.2rem;
    color: #5b21b6;
    margin-bottom: 10px;
}

.cross-header .subtitle {
    font-size: 1.05rem;
    color: #666;
}

/* 數據源選擇 */
.source-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.source-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.source-card h3 {
    color: #5b21b6;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.source-card .source-status {
    padding: 12px;
    border-radius: 10px;
    background: #f5f3ff;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #555;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.source-card .source-status.loaded {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.source-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-source {
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
}

.btn-source:hover {
    border-color: #5b21b6;
    color: #5b21b6;
}

.btn-analyze {
    display: block;
    margin: 0 auto 30px;
    padding: 16px 50px;
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 33, 182, 0.3);
}

.btn-analyze:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 結果區域 */
.cross-result {
    display: none;
}

.cross-result.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* 摘要卡片 */
.summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-top: 4px solid #7c3aed;
}

.summary-card h4 {
    color: #5b21b6;
    margin-bottom: 10px;
    font-size: 1rem;
}

.summary-card .summary-detail {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

.summary-card .summary-detail strong {
    color: #1f2937;
}

/* 分析段落 */
.analysis-section {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.analysis-section h3 {
    color: #5b21b6;
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.analysis-section .section-subtitle {
    color: #7c3aed;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.analysis-section .section-content p {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.8;
    margin-bottom: 10px;
}

/* 共振表格 */
.resonance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.resonance-table th, .resonance-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.resonance-table th {
    background: #f5f3ff;
    color: #5b21b6;
    font-weight: 600;
}

.resonance-bar-bg {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    min-width: 100px;
}

.resonance-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    border-radius: 4px;
}

/* 存檔選擇彈窗 */
.saves-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.saves-modal-overlay.show {
    display: flex;
}

.saves-modal {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
}

.saves-modal h3 {
    color: #5b21b6;
    margin-bottom: 15px;
}

.saves-modal .close-btn {
    float: right;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.save-item {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.save-item:hover {
    border-color: #7c3aed;
    background: #f5f3ff;
}

.save-item .save-name {
    font-weight: 600;
    color: #1f2937;
}

.save-item .save-date {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
}

/* 語言選擇 */
.lang-bar {
    text-align: center;
    margin-bottom: 20px;
}

.lang-bar select {
    padding: 8px 18px;
    border: 2px solid #7c3aed;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #5b21b6;
    cursor: pointer;
}

/* 加載 */
.cross-loading {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.cross-loading.active {
    display: flex;
}

.cross-loading-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
}

.cross-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
    .source-panel, .summary-row { grid-template-columns: 1fr; }
    .cross-header h1 { font-size: 1.7rem; }
}
