/* style.css - 主样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 32px;
    color: #4361ee;
    margin-bottom: 10px;
}

.header h1 i {
    margin-right: 10px;
}

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

/* 消息提示 */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

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

/* 概览卡片 */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.overview-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.overview-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #4361ee;
}

.overview-content h3 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 5px;
}

.overview-value {
    font-size: 24px;
    font-weight: bold;
    color: #334155;
}

/* 市场状态样式 */
.market-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.status-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.status-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.status-content h3 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 5px;
}

.status-value {
    font-size: 20px;
    font-weight: bold;
    color: #334155;
    margin-bottom: 5px;
}

.status-time {
    font-size: 12px;
    color: #94a3b8;
}

/* 操作栏 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form {
    display: flex;
    gap: 5px;
}

.search-form input {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    width: 300px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-form input:focus {
    outline: none;
    border-color: #4361ee;
}

.search-form button {
    padding: 10px 20px;
    background: #4361ee;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #3a56d4;
}

.clear-search {
    color: #4361ee;
    text-decoration: none;
    font-size: 14px;
}

.clear-search:hover {
    text-decoration: underline;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background: #4361ee;
    color: white;
}

.btn-primary:hover {
    background: #3a56d4;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #334155;
}

.btn-secondary:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}

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

.btn-icon {
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    background: #dbeafe;
    color: #3b82f6;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-delete {
    background: #fee2e2;
    color: #ef4444;
}

.btn-delete:hover {
    background: #fecaca;
}

/* 刷新按钮样式 */
.btn-refresh {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-refresh:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-refresh.spinning i {
    animation: spin 1s linear infinite;
}

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

/* 表单容器 */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease;
}

.form-container h3 {
    margin-bottom: 20px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* 表单样式 */
.fund-form, .edit-fund-form {
    max-width: 600px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-help {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

.fund-tag {
    display: inline-block;
    padding: 4px 8px;
    background: #e0e7ff;
    color: #4361ee;
    border-radius: 4px;
    margin: 0 5px 5px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.fund-tag:hover {
    background: #c7d2fe;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 基金列表 */
.funds-list {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.funds-list h3 {
    margin-bottom: 20px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #cbd5e1;
}

/* 表格样式 */
.funds-table-container {
    overflow-x: auto;
}

.funds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.funds-table th {
    background: #f8fafc;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.funds-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.funds-table tbody tr:hover {
    background: #f8fafc;
}

/* 基金代码 */
.fund-code {
    display: inline-block;
    padding: 4px 8px;
    background: #e0e7ff;
    color: #4361ee;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
}

/* 涨跌颜色 */
.change-rate, .profit {
    font-weight: 500;
}

.positive {
    color: #10b981;
}

.negative {
    color: #ef4444;
}

.nav-estimate {
    font-weight: 600;
    color: #334155;
}

/* 小操作按钮 */
.action-buttons-small {
    display: flex;
    gap: 5px;
}

.delete-form {
    display: inline;
}

/* 时间列 */
.time-col {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

.time-col i {
    margin-right: 3px;
    color: #94a3b8;
}

/* Toast动画 */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #64748b;
    font-size: 14px;
    border-top: 1px solid #e2e8f0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .overview-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .market-status {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form input {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .funds-table {
        font-size: 12px;
    }
    
    .funds-table th,
    .funds-table td {
        padding: 8px 10px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .time-col {
        font-size: 10px;
    }
}