/* 微信公众号网页开发规范 - 移动端样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 100%;
    padding: 15px;
    margin: 0 auto;
    padding-bottom: 60px; /* 为导航栏留出空间 */
}

.header {
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    color: white;
    padding: 20px 15px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
}

.alert-info {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
}

/* 公式类型选择器 */
.form-type-selector {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-type-selector h2 {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.type-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.type-btn {
    flex: 1;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.type-btn.active {
    border-color: #1e88e5;
    background: #1e88e5;
    color: white;
}

.type-btn:active {
    transform: scale(0.98);
}

/* 表单行样式 */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    margin-bottom: 0;
    min-width: 120px;
}

.form-group.full-width {
    flex: 100%;
}

/* 实时数据样式 */
.real-time-data {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.real-time-data h2 {
    font-size: 18px;
    color: #1e88e5;
    margin-bottom: 15px;
    border-left: 4px solid #1e88e5;
    padding-left: 10px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.data-item:last-child {
    border-bottom: none;
}

.product-name {
    font-weight: 500;
    color: #333;
}

.price-diff {
    font-weight: 600;
    color: #e53935;
}

.price-diff.positive {
    color: #43a047;
}

/* 提醒设置样式 */
.alert-setting {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.alert-setting h2 {
    font-size: 18px;
    color: #ff9800;
    margin-bottom: 15px;
    border-left: 4px solid #ff9800;
    padding-left: 10px;
}

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

.form-group select,
.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #1e88e5;
    background: white;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
    min-height: 80px;
    resize: vertical;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    margin-left: 5px;
    min-width: 50px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-bottom: 10px;
    min-width: auto;
    position: relative;
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-primary:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* 新增：按钮加载状态 */
.btn-primary.loading {
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

.btn-cancel {
    background: #757575;
    color: white;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-bottom: 10px;
    min-width: auto;
}

.btn-danger {
    background: #e53935;
    color: white;
}

.btn-danger:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-edit {
    background: #ff9800;
    color: white;
}

.btn-edit:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* 禁用按钮样式 */
.btn-disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 10px;
    min-width: auto;
}

.btn-disabled:active {
    transform: none;
    opacity: 0.6;
}

/* 提醒列表样式 */
.alert-list {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 80px; /* 为底部导航留出足够空间 */
    padding-bottom: 20px; /* 增加底部内边距 */
}

.alert-list h2 {
    font-size: 18px;
    color: #43a047;
    margin-bottom: 15px;
    border-left: 4px solid #43a047;
    padding-left: 10px;
}

.alert-list h3 {
    font-size: 16px;
    color: #666;
    margin: 15px 0 10px 0;
    padding-left: 10px;
}

.alert-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #1e88e5;
    position: relative;
    padding-bottom: 50px; /* 为操作按钮留出空间 */
}

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

.alert-info {
    margin-bottom: 0;
}

.alert-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: nowrap;
    gap: 5px;
    width: 100%;
    min-height: 30px; /* 确保有足够高度 */
}

.alert-product, .alert-rule, .alert-status {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    flex: 1; /* 各占三分之一宽度 */
    min-width: 0;
    font-size: 14px; /* 恢复正常字体大小 */
    line-height: 1.4;
    padding: 4px 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* 确保高度填充 */
}

/* 特别为状态标签设置固定宽度，避免被挤压 */
.alert-status {
    flex: 0 0 auto; /* 不伸缩，固定宽度 */
    min-width: 60px; /* 给状态标签最小宽度 */
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 12px;
}

.status-ready {
    background: #e8f5e9;
    color: #43a047;
}

.status-waiting {
    background: #fff3e0;
    color: #ff9800;
}

.alert-product {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.alert-rule {
    color: #666;
    font-size: 14px;
    margin-right: 10px;
}

.alert-status {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.status-ready {
    background: #e8f5e9;
    color: #43a047;
}

.status-waiting {
    background: #fff3e0;
    color: #ff9800;
}

.alert-remark {
    color: #888;
    font-size: 12px;
    margin-bottom: 3px;
}

.alert-time {
    color: #999;
    font-size: 11px;
}

.alert-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
}

.empty-alerts {
    text-align: center;
    color: #999;
    padding: 30px 0;
    font-size: 14px;
}

/* 底部导航菜单样式 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    border-top: 1px solid #eee;
    padding: 8px 0;
    z-index: 1000;
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 5px 0;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bottom-nav a.active {
    color: #07c160;
}

.nav-text {
    font-size: 14px;
    margin-top: 2px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .form-row {
        flex-wrap: wrap;
    }
    
    .form-group {
        min-width: 110px;
    }
    
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .real-time-data h2,
    .alert-setting h2,
    .alert-list h2 {
        font-size: 16px;
    }
    
    .data-item {
        padding: 10px 0;
    }
    
    .alert-main {
        flex-direction: row;
        align-items: center;
        gap: 5px;
        flex-wrap: nowrap; /* 强制不换行 */
    }
    
    .alert-product, .alert-rule, .alert-status {
        flex: 1;
        min-width: 80px; /* 减小最小宽度 */
        font-size: 12px; /* 在小屏幕进一步缩小字体 */
        padding: 3px 1px;
    }
	
	.alert-status {
        flex: 0 0 auto;
        min-width: 50px;
        font-size: 11px;
    }
    
    .alert-item {
        flex-direction: column;
    }
    
    .alert-actions {
        width: 100%;
        margin-top: 10px;
        justify-content: flex-end;
    }
    
    .type-buttons {
        flex-wrap: nowrap;
    }
    
    .type-btn {
        padding: 10px 6px;
        font-size: 13px;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .form-group {
        min-width: 100px;
    }
    
    .type-btn {
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .alert-actions {
        flex-direction: row;
        gap: 5px;
    }
    
    .btn {
        width: auto;
        margin-left: 0;
    }
}

@media (max-width: 360px) {
    .type-btn {
        font-size: 11px;
        padding: 8px 2px;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 消息提示 */
.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

.message.success {
    background: #e8f5e9;
    color: #43a047;
    border: 1px solid #c8e6c9;
}

.message.error {
    background: #ffebee;
    color: #e53935;
    border: 1px solid #ffcdd2;
}

/* 微信环境检查提示样式 */
.wechat-only {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 12px;
    margin: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.wechat-only h2 {
    color: #07c160;
    margin-bottom: 20px;
}

.wechat-only p {
    color: #666;
    line-height: 1.6;
}

/* 编辑页面样式 */
.edit-container {
    max-width: 100%;
    padding: 15px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.edit-header {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 20px 15px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.edit-form {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.edit-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    background: #757575;
    color: white;
    flex: 1;
}

.btn-update {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    flex: 1;
}

/* 新增样式：帮助文本 */
.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

/* 新增样式：基金对选择器 */
.form-group.full-width select {
    width: 100%;
}

/* 新增样式：收益率输入框 */
.form-group.full-width input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: #fafafa;
    transition: border-color 0.3s;
}

.form-group.full-width input[type="number"]:focus {
    outline: none;
    border-color: #1e88e5;
    background: white;
}

/* 新增样式：基金对标签 */
.fund-pair-label {
    font-weight: 600;
    color: #333;
    background: #f0f7ff;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #1e88e5;
}

/* 新增样式：收益率显示 */
.yield-display {
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 5px;
}

.yield-display.positive {
    color: #43a047;
    background: #e8f5e9;
}

.yield-display.negative {
    color: #e53935;
    background: #ffebee;
}

/* 新增样式：规则预览 */
.rule-preview {
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.rule-preview .formula {
    font-weight: 600;
    color: #1e88e5;
}

/* 新增样式：表单验证提示 */
.validation-hint {
    font-size: 12px;
    color: #ff9800;
    margin-top: 3px;
}

/* 新增样式：VIP特权提示 */
.vip-feature {
    background: linear-gradient(135deg, #ffd700, #ffa000);
    color: #333;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

/* 新增样式：移动端优化 */
@media (max-width: 768px) {
    .help-text {
        font-size: 11px;
    }
    
    .fund-pair-label {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .yield-display {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .rule-preview {
        font-size: 13px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .help-text {
        font-size: 10px;
    }
    
    .fund-pair-label {
        font-size: 13px;
    }
    
    .yield-display {
        font-size: 12px;
    }
}

/* ========== 完整的响应式设计 ========== */

/* PC端响应式样式 - 中等屏幕 (平板) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 700px;
        margin: 0 auto;
        padding: 20px;
        padding-bottom: 80px;
    }

    .edit-container {
        max-width: 700px;
        margin: 0 auto;
        padding: 20px;
        padding-bottom: 80px;
    }

    .header {
        padding: 25px 20px;
        margin-bottom: 25px;
        border-radius: 0 0 20px 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .edit-header {
        padding: 25px 20px;
        margin-bottom: 25px;
        border-radius: 0 0 20px 20px;
    }

    .edit-header h1 {
        font-size: 22px;
    }

    .form-type-selector,
    .real-time-data,
    .alert-setting,
    .alert-list {
        padding: 20px;
        margin-bottom: 25px;
        border-radius: 16px;
    }

    .form-type-selector h2,
    .real-time-data h2,
    .alert-setting h2,
    .alert-list h2 {
        font-size: 19px;
    }

    .type-btn {
        padding: 14px 10px;
        font-size: 15px;
        min-height: 50px;
    }

    .form-group label {
        font-size: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-group.full-width input[type="number"] {
        padding: 14px;
        font-size: 16px;
    }

    .data-item {
        padding: 15px 0;
    }

    .btn-primary,
    .btn-cancel,
    .btn-disabled {
        padding: 16px;
        font-size: 17px;
    }

    .alert-item {
        padding: 16px;
    }

    .bottom-nav {
        padding: 15px 0;
    }

    .nav-text {
        font-size: 15px;
    }

    .help-text {
        font-size: 13px;
    }

    .fund-pair-label {
        font-size: 15px;
        padding: 10px 14px;
    }

    .yield-display {
        font-size: 15px;
        padding: 10px 14px;
    }

    .rule-preview {
        font-size: 15px;
        padding: 14px;
    }
}

/* PC端响应式样式 - 大屏幕 (桌面) */
@media screen and (min-width: 1025px) {
    .container {
        max-width: 900px;
        margin: 0 auto;
        padding: 30px;
        padding-bottom: 100px;
    }

    .edit-container {
        max-width: 900px;
        margin: 0 auto;
        padding: 30px;
        padding-bottom: 100px;
    }

    .header {
        padding: 30px;
        margin-bottom: 30px;
        border-radius: 0 0 24px 24px;
    }

    .header h1 {
        font-size: 24px;
    }

    .edit-header {
        padding: 30px;
        margin-bottom: 30px;
        border-radius: 0 0 24px 24px;
    }

    .edit-header h1 {
        font-size: 24px;
    }

    .form-type-selector,
    .real-time-data,
    .alert-setting,
    .alert-list {
        padding: 25px;
        margin-bottom: 30px;
        border-radius: 20px;
    }

    .form-type-selector h2,
    .real-time-data h2,
    .alert-setting h2,
    .alert-list h2 {
        font-size: 20px;
    }

    .type-btn {
        padding: 16px 12px;
        font-size: 16px;
        min-height: 56px;
    }

    .form-group label {
        font-size: 16px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .form-group.full-width input[type="number"] {
        padding: 16px;
        font-size: 17px;
    }

    .data-item {
        padding: 18px 0;
    }

    .btn-primary,
    .btn-cancel,
    .btn-disabled {
        padding: 18px;
        font-size: 18px;
    }

    .alert-item {
        padding: 20px;
    }

    .bottom-nav {
        padding: 20px 0;
    }

    .nav-text {
        font-size: 16px;
    }

    .help-text {
        font-size: 14px;
    }

    .fund-pair-label {
        font-size: 16px;
        padding: 12px 16px;
    }

    .yield-display {
        font-size: 16px;
        padding: 12px 16px;
    }

    .rule-preview {
        font-size: 16px;
        padding: 16px;
    }
}