/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background-color: #1e293b;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid #334155;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #0c4a6e, #0369a1);
    color: white;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    padding: 25px;
    gap: 25px;
    min-height: 800px;
}

@media (max-width: 1400px) {
    .main-content {
        flex-direction: column;
    }
}

.left-panel {
    flex: 1.2;
    min-width: 400px;
}

.right-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 表单区域样式 */
section {
    background-color: #1e293b;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #334155;
}

section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #334155;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    font-size: 1.2rem;
    margin-bottom: 18px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

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

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
}

.form-group {
    flex: 1;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 1rem;
    color: #e2e8f0;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.required {
    color: #f87171;
}

/* 文件上传样式 */
.file-upload {
    margin-top: 10px;
}

.file-input {
    display: none;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed #475569;
    border-radius: 8px;
    background-color: #334155;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.file-label:hover {
    border-color: #38bdf8;
    background-color: #3c4b63;
}

.file-label i {
    font-size: 2.5rem;
    color: #38bdf8;
    margin-bottom: 10px;
}

.file-label span {
    color: #94a3b8;
    font-size: 1rem;
}

.file-preview {
    margin-top: 15px;
    min-height: 60px;
    padding: 10px;
    background-color: #334155;
    border-radius: 6px;
    border: 1px solid #475569;
}

/* 按钮样式 */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
    flex: 2;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-secondary {
    background-color: #475569;
    color: white;
    flex: 1;
}

.btn-secondary:hover {
    background-color: #64748b;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* 统计数据样式 */
.stats-summary {
    display: flex;
    justify-content: space-around;
    background-color: #0f172a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #334155;
}

.stat-item {
    text-align: center;
}

.stat-label {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-right: 5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #38bdf8;
}

#total-pl.positive {
    color: #ef4444; /* 盈利（红涨，A股/期货惯例） */
}

#total-pl.negative {
    color: #10b981; /* 亏损（绿跌） */
}

/* 表格样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-filter input,
.search-filter select {
    padding: 10px 15px;
    background-color: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.search-filter input {
    width: 200px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #334155;
    background-color: #0f172a;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

thead {
    background-color: #1e293b;
}

th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #cbd5e1;
    border-bottom: 2px solid #334155;
    white-space: nowrap;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #334155;
    color: #e2e8f0;
}

tbody tr:hover {
    background-color: #2d3748;
    cursor: pointer;
}

/* 交易方向样式（红涨绿跌） */
.direction-long {
    color: #ef4444; /* 多头=红 */
    font-weight: 600;
}

.direction-short {
    color: #10b981; /* 空头=绿 */
    font-weight: 600;
}

/* 盈亏样式（红涨绿跌） */
.profit {
    color: #ef4444; /* 盈利=红 */
    font-weight: 600;
}

.loss {
    color: #10b981; /* 亏损=绿 */
    font-weight: 600;
}

/* 操作按钮 */
.action-btn {
    background-color: transparent;
    color: #94a3b8;
    padding: 6px 12px;
    font-size: 0.9rem;
}

.action-btn:hover {
    background-color: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

/* 编辑按钮：琥珀色，与删除（红）区分 */
.edit-btn {
    color: #f59e0b;
}

.edit-btn:hover {
    background-color: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

/* 备份提醒横幅（页面底部） */
.backup-reminder {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px auto;
    padding: 12px 16px;
    max-width: 640px;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.4);
    border-radius: 8px;
    color: #fde68a;
    font-size: 14px;
}

.backup-reminder > i {
    color: #facc15;
    font-size: 16px;
    flex-shrink: 0;
}

.backup-reminder > span {
    flex: 1;
    line-height: 1.5;
}

.btn-reminder {
    flex-shrink: 0;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: #facc15;
    color: #1a1a1a;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-reminder:hover {
    background: #fde047;
}

.btn-reminder-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #fde68a;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    padding: 4px 6px;
}

.btn-reminder-dismiss:hover {
    opacity: 1;
}

/* 保存后自动备份开关 */
.auto-backup-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.auto-backup-toggle input {
    width: auto;
    accent-color: #38bdf8;
    cursor: pointer;
}

/* 登录遮罩层 */
.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 40px 36px;
    width: 380px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.login-box h2 {
    color: #f1f5f9;
    margin-bottom: 6px;
    font-size: 22px;
}

.login-subtitle {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 28px;
}

.login-form input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 15px;
    box-sizing: border-box;
}

.login-form input:focus {
    border-color: #38bdf8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.15);
}

.login-error {
    color: #f87171;
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 6px;
}

.login-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.login-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

.login-hint {
    color: #64748b;
    font-size: 12px;
    margin-top: 18px;
}

/* 登出按钮 */
header {
    position: relative;
}

.logout-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #94a3b8;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border-color: rgba(239,68,68,0.3);
}

/* 空状态消息 */
.empty-message {
    text-align: center;
    padding: 60px 20px !important;
    color: #64748b;
    font-size: 1.1rem;
}

.empty-message i {
    margin-right: 10px;
    font-size: 1.2rem;
    color: #38bdf8;
}

/* 表格操作按钮 */
.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 15px;
}

/* 详情查看区域 */
.quick-view {
    min-height: 300px;
}

.detail-content {
    padding: 20px;
    background-color: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
    min-height: 250px;
}

.no-selection {
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    padding: 80px 20px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: #1e293b;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid #334155;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.modal-content p {
    margin-bottom: 25px;
    color: #cbd5e1;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.file-upload-modal {
    margin: 20px 0;
}

.file-label-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    border: 2px dashed #475569;
    border-radius: 8px;
    background-color: #334155;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.file-label-modal:hover {
    border-color: #38bdf8;
}

.file-label-modal i {
    font-size: 2rem;
    color: #38bdf8;
    margin-bottom: 10px;
}

/* 详情模态框样式 */
.detail-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #334155;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #f87171;
}

.detail-modal-body {
    color: #cbd5e1;
}

.detail-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #334155;
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-row {
    display: flex;
    margin-bottom: 12px;
}

.detail-label {
    flex: 0 0 150px;
    color: #94a3b8;
    font-weight: 500;
}

.detail-value {
    flex: 1;
    color: #e2e8f0;
}

/* 交易截图预览 */
.screenshot-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    border: 1px solid #475569;
    margin-top: 10px;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 0.9rem;
    border-top: 1px solid #334155;
    background-color: #0f172a;
}

footer .credit {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #475569;
}

footer .credit a {
    color: #60a5fa;
    text-decoration: none;
}

footer .credit a:hover {
    text-decoration: underline;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .container {
        border-radius: 0;
    }
    
    body {
        padding: 0;
    }
    
    .main-content {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-filter {
        width: 100%;
    }
    
    .search-filter input {
        flex: 1;
        width: auto;
    }
    
    .stats-summary {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .modal-content {
        padding: 20px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* 交易品种相关样式 */
.input-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 5px;
    font-style: italic;
}

/* A股 合约乘数锁定态 */
#standard-lot-value.input-locked {
    background-color: #1e293b;
    color: #64748b;
    cursor: not-allowed;
    border-color: #334155;
}

/* 手动输入品种文本框 */
.custom-symbol-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #334155;
    background-color: #0f172a;
    color: #e2e8f0;
    font-size: 0.95rem;
    box-sizing: border-box;
}
.custom-symbol-input:focus {
    outline: none;
    border-color: #38bdf8;
}

/* 手数计算器样式 */
.position-input-container {
    position: relative;
}

.lot-calculator {
    margin-top: 10px;
    padding: 10px;
    background-color: #334155;
    border-radius: 6px;
    border-left: 3px solid #0ea5e9;
}

.lot-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

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

.lot-info span:first-child {
    color: #94a3b8;
}

.lot-info span:last-child {
    color: #38bdf8;
    font-weight: 600;
}

/* 风险管理输入容器 */
.risk-input-container {
    position: relative;
}

.risk-info {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

.risk-info span:last-child {
    color: #38bdf8;
    font-weight: 500;
}

/* 风险结果容器 */
.risk-result-container {
    position: relative;
}

.risk-details {
    margin-top: 10px;
    padding: 10px;
    background-color: #334155;
    border-radius: 6px;
    border-left: 3px solid #10b981;
}

.risk-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

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

.risk-detail-item span:first-child {
    color: #94a3b8;
}

.risk-detail-item span:last-child {
    color: #10b981;
    font-weight: 600;
}

/* 交易品种预设值显示 */
.symbol-preset {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background-color: #475569;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #cbd5e1;
}

/* 表格中交易品种列样式 */
.symbol-cell {
    font-family: monospace;
    font-weight: 600;
    color: #fbbf24;
}

/* 交易品种颜色标识 */
.symbol-gold { color: #fbbf24; }      /* 黄金 */
.symbol-forex { color: #38bdf8; }     /* 外汇 */
.symbol-index { color: #10b981; }     /* 指数 */
.symbol-crypto { color: #8b5cf6; }    /* 加密货币 */
.symbol-stock { color: #ef4444; }     /* 股票 */

/* 按市场区分的品种配色 */
.symbol-ashare { color: #f87171; }     /* A股 */
.symbol-future { color: #38bdf8; }     /* 商品期货 */

/* 自定义交易品种输入框 */
.custom-symbol-container {
    margin-top: 10px;
    display: none;
}

.custom-symbol-container.show {
    display: block;
}

/* 高级计算结果显示 */
.advanced-calc-panel {
    margin-top: 20px;
    padding: 15px;
    background-color: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
}

.advanced-calc-title {
    font-size: 1rem;
    color: #38bdf8;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.advanced-calc-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.advanced-calc-label {
    font-size: 0.85rem;
    color: #94a3b8;
}

.advanced-calc-value {
    font-size: 1.1rem;
    color: #e2e8f0;
    font-weight: 600;
}

.advanced-calc-value.positive {
    color: #10b981;
}

.advanced-calc-value.negative {
    color: #f87171;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .advanced-calc-grid {
        grid-template-columns: 1fr;
    }
    
    .lot-calculator,
    .risk-details {
        font-size: 0.85rem;
    }
}

/* 日期范围搜索样式 */
.date-range-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-range-filter input {
    padding: 10px 12px;
    background-color: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.95rem;
    width: 140px;
}

.date-range-filter span {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* 排序表头样式 */
.sortable-header {
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background-color 0.2s;
}

.sortable-header:hover {
    background-color: #2d3748;
}

.sortable-header i {
    margin-left: 8px;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.sortable-header:hover i {
    opacity: 1;
}

.sortable-header.sort-asc i.fa-sort-up,
.sortable-header.sort-desc i.fa-sort-down {
    opacity: 1;
    color: #38bdf8;
}

/* 表格排序指示器 */
.sort-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
}

/* 清除日期按钮 */
.clear-date-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 6px;
    margin-left: 5px;
    border-radius: 3px;
}

.clear-date-btn:hover {
    background-color: #475569;
    color: #e2e8f0;
}

/* 图表容器样式 */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.chart-wrapper {
    background-color: #0f172a;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #334155;
}

.chart-wrapper h3 {
    font-size: 1rem;
    color: #38bdf8;
    margin-bottom: 10px;
    text-align: center;
}

/* 快速筛选按钮 */
.quick-filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.quick-filter-btn {
    padding: 6px 12px;
    background-color: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
    color: #cbd5e1;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-filter-btn:hover {
    background-color: #475569;
    border-color: #64748b;
}

.quick-filter-btn.active {
    background-color: #0ea5e9;
    border-color: #0284c7;
    color: white;
}

/* 响应式调整 */
@media (max-width: 1400px) {
    .date-range-filter {
        flex-wrap: wrap;
    }
    
    .date-range-filter input {
        width: 120px;
    }
}

@media (max-width: 768px) {
    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-range-filter {
        width: 100%;
        justify-content: space-between;
    }
    
    .date-range-filter input {
        flex: 1;
        min-width: 0;
    }
    
    .search-filter select {
        width: 100%;
    }
}

/* 实际风险建议样式 */
.actual-risk-suggestions {
    margin-top: 10px;
}

.suggestion-title {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 5px;
}

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

.suggestion-btn {
    padding: 6px 12px;
    background-color: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
    color: #cbd5e1;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background-color: #475569;
    border-color: #64748b;
}

.suggestion-btn:active {
    background-color: #3b82f6;
    border-color: #2563eb;
}

/* 风险百分比样式 */
.risk-percent {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-left: 5px;
}

/* 风险统计样式 */
.risk-stats-summary {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    padding: 10px;
    background-color: #0f172a;
    border-radius: 6px;
    border: 1px solid #334155;
}

.risk-stat-item {
    text-align: center;
}

.risk-stat-label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 3px;
}

.risk-stat-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #38bdf8;
}

/* 实际风险输入包装器 */
.actual-risk-input-wrapper {
    position: relative;
}

.actual-risk-hint {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #94a3b8;
    background-color: rgba(30, 41, 59, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* 风险说明样式 */
.risk-explanation {
    margin-top: 15px;
    padding: 12px;
    background-color: #0f172a;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.risk-explanation p {
    margin: 0;
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.risk-explanation i {
    color: #3b82f6;
    margin-right: 8px;
}

/* 实际风险百分比样式 */
#actual-risk-percent {
    font-weight: 600;
    color: #fbbf24;
}

#actual-risk-percent.low {
    color: #10b981; /* 绿色，表示风险控制好 */
}

#actual-risk-percent.high {
    color: #ef4444; /* 红色，表示风险较高 */
}

/* 风险比较指示器 */
.risk-comparison {
    display: flex;
    align-items: center;
    margin-top: 8px;
    font-size: 0.85rem;
}

.risk-comparison-bar {
    flex: 1;
    height: 6px;
    background-color: #334155;
    border-radius: 3px;
    margin: 0 10px;
    overflow: hidden;
    position: relative;
}

.risk-comparison-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444);
    width: 50%; /* 初始值，动态调整 */
}

.risk-comparison-marker {
    position: absolute;
    top: -2px;
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 50%;
    border: 2px solid #1e293b;
    transform: translateX(-50%);
}

/* 实际风险历史提示 */
.actual-risk-history {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.actual-risk-history-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.actual-risk-history-item:last-child {
    margin-bottom: 0;
}

/* ========== 移动端响应式 (≤768px) ========== */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }

    /* 头部 */
    header h1 {
        font-size: 18px;
    }
    header .subtitle {
        font-size: 12px;
    }
    .logout-btn {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* 登录遮罩 */
    .login-overlay {
        padding: 20px;
    }
    .login-box {
        width: 100%;
        max-width: 340px;
        padding: 28px 20px;
    }

    /* 两栏 → 单栏 */
    .main-content {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* 表单全宽 + 大触摸区 */
    .form-row {
        flex-direction: column;
        gap: 14px;
    }
    .form-row .form-group {
        width: 100%;
    }
    .add-transaction {
        padding: 14px;
    }
    .form-section {
        margin-bottom: 18px;
        padding-bottom: 14px;
    }
    .form-section h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px 14px;          /* 加大触摸区 */
        font-size: 16px;             /* 防止 iOS 自动放大 */
        min-height: 48px;            /* 移动端建议最低 44~48px */
        box-sizing: border-box;
    }
    .form-group textarea {
        min-height: 80px;
    }
    .input-hint {
        font-size: 12px;
    }
    .required {
        margin-left: 2px;
    }

    /* 统计卡片横排换行 */
    .stats-summary {
        flex-wrap: wrap;
        gap: 8px;
    }
    .stat-item {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
        padding: 10px 8px;
    }
    .stat-label {
        font-size: 12px;
    }
    .stat-value {
        font-size: 16px;
    }

    /* 筛选器纵向排列 */
    .search-filter {
        flex-wrap: wrap;
        gap: 8px;
    }
    .search-filter input,
    .search-filter select {
        flex: 1 1 calc(50% - 8px);
        min-width: 130px;
        padding: 12px 12px;
        min-height: 44px;
    }
    .date-range-filter {
        flex: 1 1 100%;
    }
    .date-range-filter input {
        min-width: 0;
        flex: 1;
    }

    /* 表格横滚 + 操作列固定 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }
    #transactions-table {
        min-width: 900px;
        font-size: 13px;
    }
    #transactions-table th,
    #transactions-table td {
        padding: 8px 6px;
    }

    .table-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    .table-actions button,
    .table-actions label {
        flex: none;
        font-size: 12px;
        padding: 8px 12px;
        min-height: 40px;
    }
    .auto-backup-toggle {
        margin-left: 0;
        flex: 1 1 100%;
    }

    /* 表单操作按钮 */
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    .form-actions button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        min-height: 48px;
    }

    /* 图表缩小高度 */
    .chart-wrapper {
        width: 100%;
        margin-bottom: 12px;
    }
    .chart-wrapper h3 {
        font-size: 14px;
    }

    /* 详情弹窗 */
    .detail-modal-content {
        max-width: 95vw;
        padding: 16px;
    }
    .modal-content {
        padding: 18px;
    }
    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    .modal-actions button {
        width: 100%;
    }

    /* 底部备份横幅 */
    .backup-reminder {
        flex-wrap: wrap;
        font-size: 12px;
        text-align: center;
        justify-content: center;
        padding: 10px 12px;
    }
    .backup-reminder > span {
        flex: 1 1 100%;
        text-align: left;
    }
    .backup-reminder > i {
        display: none;
    }

    /* Footer */
    footer {
        font-size: 12px;
        padding: 10px;
    }
}

/* ========== 超小屏 (≤480px) ========== */
@media (max-width: 480px) {
    .stat-item {
        flex: 1 1 100%;
    }
    .search-filter input,
    .search-filter select {
        flex: 1 1 100%;
    }
    .login-box {
        max-width: 100%;
    }
}