/* ========================================
   组件样式 - 按钮、输入框、卡片等
   ======================================== */

/* === 卡片（玻璃态） === */
.card {
    background: rgba(15, 12, 41, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2::before {
    content: '◆';
    color: #764ba2;
}

/* === 按钮 === */
button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

button.secondary-button {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

button.secondary-button:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 6px 25px rgba(46, 204, 113, 0.6);
}

/* 统一放大选框 */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* 统一放大单选按钮 */
input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
}

/* === 加载动画 === */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #667eea;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* === 错误提示 === */
.error {
    display: none;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #ff6b6b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error.show {
    display: block;
}

/* === 信息提示 === */
.info-text {
    color: #a8b2d1;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* === 工具提示 === */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 12, 41, 0.95);
    color: #e0e6ed;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.5);
    font-size: 0.85rem;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 扫描结果卡片 */
.scan-card {
    border: 1px solid #1f2937;
    padding: 12px;
}

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

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.status-badge.success {
    background: #122e1f;
    color: #4ade80;
}

.status-badge.error {
    background: #3b1616;
    color: #f87171;
}

.metric-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    font-size: 0.9rem;
}

.metric-mini-grid .metric-label {
    color: #94a3b8;
    margin-right: 6px;
}

.scan-card-actions {
    margin-top: 10px;
    text-align: right;
}

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pagination button {
    padding: 6px 10px;
    background: #1f2937;
    color: #e5e7eb;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.scan-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.scan-tab-button {
    min-width: 120px;
    text-align: center;
    padding: 10px 14px;
}

.fund-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.fund-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === 表格样式 === */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

thead tr {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

th {
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid rgba(102, 126, 234, 0.5);
    color: #e0e6ed;
    font-weight: 600;
}

td {
    padding: 10px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* === 下载结果样式 === */
.download-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.summary-section {
    padding: 15px;
    border-radius: 10px;
    background: rgba(15, 12, 41, 0.4);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.summary-section h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #e0e6ed;
}

.summary-section.success {
    border-color: rgba(40, 167, 69, 0.5);
    background: rgba(40, 167, 69, 0.1);
}

.summary-section.success h3 {
    color: #28a745;
}

.summary-section.error {
    border-color: rgba(220, 53, 69, 0.5);
    background: rgba(220, 53, 69, 0.1);
}

.summary-section.error h3 {
    color: #dc3545;
}

.code-list {
    color: #a8b2d1;
    line-height: 1.8;
}

.failed-item {
    padding: 10px;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    color: #e0e6ed;
}

.failed-item strong {
    color: #dc3545;
}

/* === 加载因子样式 === */
.loading-factors {
    text-align: center;
    color: #a8b2d1;
    padding: 20px;
}

/* === 响应式调整 === */
@media (max-width: 1024px) {
    .card {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .card {
        padding: 18px;
        margin-bottom: 18px;
    }
    
    button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .card h2 {
        font-size: 1.25rem;
    }
    
    button {
        padding: 12px 16px;
    }
}

