/* static/css/landing.css - 优化响应式和页面宽度版本 */

/* 引入 Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

/* ==============================================
   基础变量定义
   ============================================== */
:root {
    /* 主题色彩 */
    --primary-color: #007bff;       /* 主色调：深蓝色 */
    --secondary-color: #6C757D;     /* 次要色调：灰色 */
    --accent-color: #28a745;        /* 强调色：绿色 */
    --danger-color: #dc3545;        /* 警告色：红色 */
    --warning-color: #ffc107;       /* 提醒色：黄色 */

    /* 背景与文本 */
    --background-light: #f4f7f6;    /* 浅背景色 (稍稍调整) */
    --background-card: #ffffff;     /* 卡片背景色 */
    --text-dark: #212529;           /* 深色文本 (更深) */
    --text-light: #6C757D;          /* 浅色文本 */
    --border-light: #dee2e6;        /* 浅边框色 */
    --shadow-light: rgba(0, 0, 0, 0.07); /* 柔和阴影 */
    --hover-light: #f7faff;        /* 悬停高亮色 (浅蓝) */

    /* 第三方平台色彩 */
    --binance-color: #F0B90B;       /* 币安黄色 */
    --tradingview-color: #2962FF;   /* TradingView 蓝色 */

    /* 指标与价格色彩 */
    --rsi-high-color: var(--danger-color);    /* RSI高位色 */
    --rsi-low-color: var(--accent-color);     /* RSI低位色 */
    --price-up-color: var(--accent-color);    /* 价格上涨色 */
    --price-down-color: var(--danger-color);  /* 价格下跌色 */
}

/* ==============================================
   全局样式
   ============================================== */
body {
    font-family: 'Inter', 'Helvetica Neue', 'Arial', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1800px; /* 限制最大宽度 */
    margin: 0 auto;
    padding: 24px; /* 增加页面呼吸感 */
    box-sizing: border-box; /* 确保padding不影响总宽度 */
}

/* ==============================================
   网格布局 (新增)
   ============================================== */
.grid-container {
    display: grid;
    /* 自动填充列，每列最小450px，最大1fr (弹性) */
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px; /* 卡片间距 */
}

.full-width {
    grid-column: 1 / -1; /* 跨越所有列 */
}


/* ==============================================
   头部样式
   ============================================== */
.app-header {
    text-align: center;
    margin-bottom: 40px;
}

.app-header h1 {
    font-size: 40px; /* 增大字号 */
    font-weight: 700;
    color: var(--text-dark); /* 改为深色文本 */
    margin-bottom: 8px; /* 减小间距 */
    letter-spacing: -1px;
}

.app-header .app-description {
    font-size: 18px; /* 增大字号 */
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ==============================================
   卡片通用样式
   ============================================== */
.card {
    background-color: var(--background-card);
    border-radius: 16px; /* 增大圆角 */
    box-shadow: 0 4px 15px var(--shadow-light);
    padding: 24px 32px; /* 增大内边距 */
    margin-bottom: 0; /* 网格布局的 gap 会处理间距 */
    border: none; /* 移除边框，依赖阴影 */
    transition: box-shadow 0.3s ease;
}
.card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}

.card h2 {
    font-size: 24px; /* 增大字号 */
    font-weight: 600;
    color: var(--text-dark); /* 改为深色文本 */
    margin-top: 0;
    margin-bottom: 24px; /* 增大底部间距 */
    display: flex;
    align-items: center;
    gap: 12px;
}

.card h2 svg {
    color: var(--primary-color); /* 图标使用主题色 */
    flex-shrink: 0;
}

/* 卡片头部样式 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0; /* 移除内边距 */
    padding-bottom: 20px; /* 增加底部间距 */
    border-bottom: 1px solid var(--border-light); /* 增加分割线 */
    margin-bottom: 20px; /* 移动 .card h2 的间距到这里 */
}

.card-header h2 {
    margin: 0;
    padding: 0;
    border: none;
    margin-bottom: 0; /* 移除 h2 默认间距 */
}

/* ==============================================
   按钮通用样式 (基本不变)
   ============================================== */
.btn-primary, 
.btn-secondary, 
.btn-stop, 
.binance-btn, 
.tradingview-btn, 
.alert-toggle-btn,
.autotrade-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    outline: none;
    line-height: 1;
    height: 40px;
    box-sizing: border-box;
}

/* 主按钮 */
.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
}
.btn-primary:hover:not(:disabled) {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.25);
}

/* 次要按钮 */
.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-light);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--background-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* 停止按钮 */
.btn-stop {
    background-color: var(--danger-color);
    color: #fff;
    border: 1px solid var(--danger-color);
}
.btn-stop:hover:not(:disabled) {
    background-color: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.25);
}

/* 禁用状态 */
.btn-primary:disabled, 
.btn-secondary:disabled, 
.btn-stop:disabled {
    background-color: #e9ecef;
    color: var(--text-light);
    border-color: var(--border-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap; /* 允许换行 */
}

/* 图标按钮 */
.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    color: var(--text-light);
}
.btn-icon:hover {
    background-color: var(--background-light);
    color: var(--primary-color);
}
.btn-icon svg {
    color: inherit; /* 继承 .btn-icon 的颜色 */
}

/* 报警与自动交易开关按钮 */
.alert-toggle-btn, 
.autotrade-toggle-btn {
    padding: 6px 15px;
    font-size: 13px;
    border-radius: 20px;
    background-color: var(--background-light);
    border: 1px solid var(--border-light);
    color: var(--text-light);
    font-weight: 500;
    min-width: 80px;
    height: 32px;
}
.alert-toggle-btn.active, 
.autotrade-toggle-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.alert-toggle-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}
.alert-toggle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 币安与TradingView按钮 */
.binance-btn, 
.tradingview-btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    min-width: 65px;
    height: 32px;
}

.binance-btn {
    background-color: var(--binance-color);
    color: #17181B;
    border: 1px solid var(--binance-color);
}
.binance-btn:hover:not(:disabled) {
    background-color: #e0ac0a;
    border-color: #e0ac0a;
}

.tradingview-btn {
    background-color: var(--tradingview-color);
    color: white;
    border: 1px solid var(--tradingview-color);
}
.tradingview-btn:hover:not(:disabled) {
    background-color: #0039CB;
    border-color: #0039CB;
}

/* 收藏按钮 */
.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 0 8px;
    color: var(--border-light);
    transition: transform 0.2s, color 0.2s;
    line-height: 1;
}
.favorite-btn:hover {
    transform: scale(1.1);
    color: var(--warning-color);
}
.favorite-btn.favorited {
    color: var(--warning-color);
}

/* ==============================================
   输入框和选择框
   ============================================== */
input[type="text"], 
input[type="number"], 
input[type="url"], 
select {
    padding: 10px 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Inter', sans-serif; /* 确保字体一致 */
    color: var(--text-dark);
    background-color: #fff; /* 改为白色背景 */
    outline: none;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    height: 40px;
    box-sizing: border-box;
    width: 100%; /* 为模态框中的输入框提供默认宽度 */
}
input[type="text"]:focus, 
input[type="number"]:focus, 
input[type="url"]:focus, 
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
input[readonly] {
    background-color: var(--background-light);
    cursor: not-allowed;
}

/* ==============================================
   消息提示
   ============================================== */
.info-message {
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 20px;
    color: var(--text-dark);
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
}
.info-message .info-text {
    color: inherit;
}

/* 消息类型 */
.info-message.success { background-color: #d4edda; border-color: #c3e6cb; color: #155724; }
.info-message.error   { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.info-message.info    { background-color: #d1ecf1; border-color: #bee5eb; color: #0c5460; }

/* 文本样式 */
.small-text {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 5px;
    margin-bottom: 5px;
}
.bold-info-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 15px;
}
.text-right {
    text-align: right;
}

/* ============================================== */
/* 账户信息模块样式 */
/* ============================================== */
/* 账户信息容器使用与其他卡片一致的样式 */
#account-info-section {
    background-color: var(--background-card);
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow-light);
    padding: 24px 32px;
    margin-bottom: 0;
    border: none;
    transition: box-shadow 0.3s ease;
}

#account-info-section:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}

/* 账户信息内部布局 */
.account-info-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 3px;
}

.account-info-item {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.account-info-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.8;
}

.account-info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Roboto Mono', 'Monaco', 'Menlo', monospace;
    line-height: 1.2;
    transition: color 0.3s ease;
}

/* 盈亏金额颜色变化 */
#today-pnl.positive, #today-pnl-percent.positive {
    color: var(--accent-color);
}

#today-pnl.negative, #today-pnl-percent.negative {
    color: var(--danger-color);
}

/* 账户信息更新时间 */
#account-info-last-updated {
    text-align: left;
    font-size: 10px;
    color: var(--text-light);
    margin-top: 10px;
    font-style: italic;
    opacity: 0.8;
}

#account-info-section:hover #account-info-last-updated {
    opacity: 0.8;
}


/* 价格与涨跌幅文本 */
.text-success { color: var(--price-up-color); font-weight: 600; }
.text-danger  { color: var(--price-down-color); font-weight: 600; }

/* ==============================================
   表格样式 (重大调整)
   ============================================== */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse; /* 改为合并边框模型 */
    border-spacing: 0;
    margin-top: 0; /* h2 已有间距 */
}

th, td {
    padding: 14px 16px; /* 统一内边距 */
    text-align: left;
    vertical-align: middle;
    white-space: nowrap; /* 防止表格内容换行 */
}

th {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    background-color: var(--background-light);
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid var(--border-light); /* 强化表头底线 */
    letter-spacing: 0.5px;
}
/* 移除 th 的圆角 */
th:first-child { border-top-left-radius: 0; }
th:last-child  { border-top-right-radius: 0; }

tr {
    background-color: var(--background-card);
    transition: background-color 0.2s ease-in-out;
    border-radius: 0; /* 移除 tr 的圆角 */
    box-shadow: none; /* 移除 tr 的阴影 */
    border-bottom: 1px solid var(--border-light); /* 添加行分隔线 */
}
tr:last-child {
    border-bottom: none; /* 最后一行不需要底线 */
}
tr:hover {
    background-color: var(--hover-light); /* 统一悬停色 */
}

/* 移除 td 的圆角 */
td:first-child { border-top-left-radius: 0; border-bottom-left-radius: 0; }
td:last-child  { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* 表格单元格特殊样式 */
td.symbol-link-cell {
    font-weight: 500;
    cursor: pointer;
    color: var(--primary-color);
}
td.symbol-link-cell:hover {
    text-decoration: underline;
}

td .price {
    font-family: 'Roboto Mono', monospace; /* 使用等宽字体 */
    font-size: 15px;
    font-weight: 600;
    min-width: 100px; /* 确保价格列有足够的宽度 */
}

/* RSI值样式 */
td.text-danger { color: var(--rsi-high-color); font-weight: 600; }
td.text-success { color: var(--rsi-low-color); font-weight: 600; }

/* 统计表格 (自动交易历史) */
.stats-table {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
}
.stats-table th {
    background-color: var(--background-light);
}
.stats-table td {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    font-size: 16px;
}
.stats-table select {
    width: 150px;
    height: 36px;
    font-size: 13px;
    padding: 5px 10px;
}

/* ==============================================
   统计卡片样式 (新增)
   ============================================== */
.stats-grid-container {
    display: grid;
    /* 自动适应列，最小 350px，最大 1fr (弹性) */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px; /* 卡片间距 */
    margin-bottom: 24px; /* 与下方的历史表格拉开距离 */
}

.stat-box {
    /* 使用稍暗的背景色以区别于卡片白底 */
    background-color: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: 12px; /* 圆角 */
    padding: 20px 24px; /* 内边距 */
}

.stat-box-header {
    display: flex;
    justify-content: space-between; /* 标题和下拉框左右对齐 */
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-light); /* 分隔线 */
}

.stat-box-header h3 {
    margin: 0;
    font-size: 18px; /* 统计箱的标题 */
    font-weight: 600;
    color: var(--text-dark);
}

.stat-box-header select.stats-push-schedule-select {
    width: 150px;
    height: 36px;
    font-size: 13px;
    padding: 5px 10px;
    background-color: var(--background-card); /* 下拉框使用白色背景 */
    border: 1px solid var(--border-light);
}

.stat-box-body {
    display: flex;
    flex-direction: column; /* 垂直堆叠统计项 */
    gap: 12px; /* 统计项之间的间距 */
}

.stat-item {
    display: flex;
    justify-content: space-between; /* 标签和数值左右对齐 */
    align-items: baseline; /* 基线对齐 */
    padding: 8px 0; /* 上下留出呼吸空间 */
    border-bottom: 1px solid var(--border-light); /* 浅色分隔线 */
}
.stat-item:last-child {
    border-bottom: none; /* 最后一项不需要分隔线 */
}

.stat-label {
    font-size: 14px;
    color: var(--text-light); /* 标签使用浅色文本 */
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    /* 使用等宽字体，让数字跳动时更整齐 */
    font-family: 'Roboto Mono', monospace; 
    color: var(--text-dark);
}

/* 针对“总净收益”这一项进行特殊美化 */
.stat-item:last-child {
    padding-top: 12px;
}
.stat-item:last-child .stat-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark); /* 标签加粗 */
}
.stat-item:last-child .stat-value {
    font-size: 22px; /* 数值放大 */
    font-weight: 700;
    /* 颜色将由 JS 自动添加的 .text-success 或 .text-danger 类来控制 */
}

/* ==============================================
   功能区域样式
   ============================================== */
/* 扫描和刷新控制区 */
.binance-search-container {
    display: flex;
    gap: 15px;
    align-items: center;
}
.binance-search-container input {
    flex-grow: 1;
    background-color: var(--background-light); /* 搜索框用浅色背景 */
}

.refresh-controls-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.refresh-controls-inline label {
    font-weight: 500;
    color: var(--text-dark);
}
.refresh-controls-inline input[type="number"],
.refresh-controls-inline select {
    width: 80px;
    text-align: center;
    background-color: var(--background-light); /* 控件用浅色背景 */
}

/* 飞书设置和推送 */
.feishu-settings-container .setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.feishu-settings-container .setting-item label {
    min-width: 150px;
    font-weight: 500;
    color: var(--text-dark);
}
.feishu-settings-container .setting-item input {
    flex-grow: 1;
}

/* 自动交易历史滚动容器 */
.autotrade-history-scroll-container {
    max-height: 960px; /* 20行 * 48px/行 = 960px */
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0; /* 移除内边距 */
    margin-top: 20px;
}
.autotrade-history-scroll-container table {
    margin-top: 0;
}

/* 策略卡片折叠样式 (从 HTML 移入) */
#strategy-card-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 移除 .card-header 的样式, 使用 h2 的默认样式 */
    padding: 0;
    border-bottom: none;
    margin-bottom: 20px;
}
#strategy-card-header h2 {
    margin-bottom: 0;
}
#strategy-arrow {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-light);
    transition: transform 0.3s;
}
#strategy-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}
#strategy-card-body.expanded {
    max-height: 1000px; /* 使用一个足够大的值 */
}


/* ==============================================
   模态框 (Modal) 样式 (不变)
   ============================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex; /* 可见时居中内容 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.modal-header h3 {
    margin: 0;
}

.btn-close-modal {
    font-size: 1.5rem;
    font-weight: bold;
    color: #aaa;
    line-height: 1;
}
.btn-close-modal:hover {
    color: #666;
}

.modal-body .form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ==============================================
   Toast 消息提示样式 (不变)
   ============================================== */
.toast-message {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 10000;
    background-color: #333;
    color: white;
    padding: 14px 25px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    font-size: 1.05em;
    font-weight: bold;
    opacity: 1;
    animation: fadeIn 0.5s forwards;
    cursor: pointer;
}

/* 消息类型色彩 */
.toast-message.success { background-color: #28a745; }
.toast-message.error   { background-color: #dc3545; }
.toast-message.warning { background-color: #fd7e14; }
.toast-message.info    { background-color: #007bff; }

/* 进入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   核心工具类
   ============================================== */
.hidden {
    display: none !important; /* 强制隐藏 */
}

/* ==============================================
   响应式调整
   ============================================== */
@media (max-width: 1200px) {
    th, td { padding: 10px 12px; }
    
    .binance-btn, 
    .tradingview-btn, 
    .alert-toggle-btn, 
    .autotrade-toggle-btn { 
        padding: 5px 10px; 
        font-size: 12px; 
        min-width: 55px; 
        height: 30px; 
    }
    
    .favorite-btn { font-size: 20px; }

    /* 堆叠控件 */
    .refresh-controls-inline { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .refresh-controls-inline label, 
    .refresh-controls-inline input, 
    .refresh-controls-inline select, 
    .refresh-controls-inline .btn-primary, 
    .refresh-controls-inline .btn-stop { 
        width: 100%; 
        text-align: center; 
    }
}

@media (max-width: 992px) {
    .app-header h1 { font-size: 32px; }
    .app-header .app-description { font-size: 15px; }
    
    .card { padding: 20px 25px; }
    .card h2 { font-size: 20px; }
    
    .binance-search-container { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .binance-search-container input, 
    .binance-search-container .btn-primary { 
        width: 100%; 
    }
        
    .feishu-settings-container .setting-item { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 8px; 
    }
    .feishu-settings-container .setting-item label { 
        min-width: auto; 
        width: 100%; 
    }
    .feishu-settings-container .setting-item input { 
        width: 100%; 
    }
        
    .text-right { text-align: left; }

    /* 响应式统计卡片 */
    .stats-grid-container {
        /* 在中等屏幕上强制单列，避免 350px*2 挤在一起 */
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container { margin: 0 auto; padding: 15px; } /* 调整移动端边距 */
    
    .app-header h1 { font-size: 28px; }
    .app-header .app-description { font-size: 14px; }
    
    .card { 
        padding: 15px 20px; 
    }
    .card h2 { 
        font-size: 18px; 
        margin-bottom: 15px; 
    }
    
    .btn-primary, 
    .btn-secondary, 
    .btn-stop, 
    .binance-btn, 
    .tradingview-btn, 
    .alert-toggle-btn {
        padding: 8px 15px; 
        font-size: 14px; 
        height: 36px; 
        min-width: auto;
    }
    
    input[type="text"], 
    input[type="number"], 
    input[type="url"], 
    select { 
        padding: 8px 12px; 
        font-size: 14px; 
        height: 36px; 
    }
    
    th, td { 
        padding: 8px 10px; 
        font-size: 12px; 
    }
    
    .binance-btn, 
    .tradingview-btn, 
    .alert-toggle-btn { 
        padding: 5px 8px; 
        font-size: 11px; 
        height: 28px; 
        border-radius: 4px; 
    }
    
    .favorite-btn { 
        font-size: 18px; 
        padding: 0 5px; 
    }
    
    /* 表格列最小宽度调整 (保持不变) */
    th:nth-child(1), td:nth-child(1) { min-width: 90px; }
    th:nth-child(2), td:nth-child(2) { min-width: 100px; }
    th:nth-child(3), td:nth-child(3) { min-width: 70px; }
    th:nth-child(4), td:nth-child(4) { min-width: 70px; }
    th:nth-child(5), td:nth-child(5) { min-width: 90px; }
    th:nth-child(6), td:nth-child(6) { min-width: 80px; }
    th:nth-child(11), td:nth-child(11) { text-align: center; min-width: 60px; }
    th:nth-child(12), td:nth-child(12) { text-align: center; min-width: 80px; }
    
    #trading-pairs-table th:nth-child(13), 
    #trading-pairs-table td:nth-child(13),
    #favorites-table th:nth-child(13), 
    #favorites-table td:nth-child(13),
    #search-result-table th:nth-child(13), 
    #search-result-table td:nth-child(13) { 
        text-align: center; 
        min-width: 85px; 
    }

    /* 响应式统计卡片 */
    .stat-box {
        padding: 15px;
    }
    .stat-box-header {
        flex-direction: column; /* 标题和下拉框垂直堆叠 */
        align-items: flex-start; /* 左对齐 */
        gap: 10px;
    }
    .stat-box-header select.stats-push-schedule-select {
        width: 100%; /* 下拉框占满宽度 */
    }
    .stat-label {
        font-size: 13px;
    }
    .stat-value {
        font-size: 16px;
    }
    .stat-item:last-child .stat-value {
        font-size: 20px;
    }
}