:root {
    --primary-color: #6366f1; /* Indigo 500 */
    --primary-hover: #4f46e5; /* Indigo 600 */
    --primary-light: #e0e7ff; /* Indigo 100 */
    --secondary-bg: #f3f4f6; /* Gray 100 */
    --surface-bg: #ffffff;
    --text-primary: #111827; /* Gray 900 */
    --text-secondary: #6b7280; /* Gray 500 */
    --border-color: #e5e7eb; /* Gray 200 */
    --danger-color: #ef4444; /* Red 500 */
    --danger-hover: #dc2626; /* Red 600 */
    --success-color: #10b981; /* Emerald 500 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* 页面容器动画 */
.page {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 头部样式 */
.header {
    background: var(--surface-bg);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.header h1 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* 卡片样式 */
.card {
    background: var(--surface-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.card h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-header h2 {
    margin-bottom: 0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    background-color: #fff;
    transition: var(--transition);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
}

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

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--secondary-bg);
    border-color: #d1d5db;
}

.btn-danger {
    background: #fee2e2;
    color: var(--danger-color);
}

.btn-danger:hover {
    background: #fecaca;
    color: var(--danger-hover);
}

.logout-btn {
   width: 100%;
  
}

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--secondary-bg);
    color: var(--primary-color);
}

.btn-icon.delete:hover {
    color: var(--danger-color);
    background: #fee2e2;
}

/* Tabs 样式 */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
}

.tab-btn:hover {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

/* 列表样式 */
.pairs-list,
.channels-list {
    display: grid;
    gap: 1rem;
}

.pair-item {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.pair-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pair-info {
    flex: 1;
}

.pair-info h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pair-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: var(--secondary-bg);
    color: var(--text-secondary);
    font-weight: 500;
}

.pair-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.price-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.price-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pair-detail {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pair-detail-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pair-actions {
    display: flex;
    gap: 0.5rem;
}

/* 价格列表样式 */
.prices-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.price-card {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.price-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.price-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.price-body {
    text-align: center;
}

.price-main {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.price-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.price-loading {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 1rem 0;
}

/* 通知渠道样式 */
.channel-item {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.channel-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.channel-item.disabled {
    opacity: 0.6;
    background: var(--secondary-bg);
}

.channel-info {
    flex: 1;
}

.channel-info h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.channel-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 500;
}

.channel-badge.enabled {
    background: #d1fae5;
    color: #065f46;
}

.channel-badge.disabled {
    background: #fee2e2;
    color: #991b1b;
}

.channel-detail {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.channel-actions {
    display: flex;
    gap: 0.5rem;
}

.channel-config {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--secondary-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.channel-config h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--surface-bg);
    padding: 0;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.close {
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover,
.close-channel:hover {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.close-channel {
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal form {
    padding: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* 消息提示框 */
.message {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.error {
    color: var(--danger-color);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* 特定页面样式修正 */
#loginPage .container {
    max-width: 440px;
    margin-top: 10vh;
}

#loginPage h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.notification-config {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--secondary-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}


/* Price Threshold Styles */
.price-threshold {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--secondary-bg);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.price-threshold.triggered {
    background: #ecfdf5;
    border: 1px solid #10b981;
}

.card-triggered {
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981;
}

.threshold-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.threshold-row:last-child {
    margin-bottom: 0;
}

.threshold-row .label {
    color: var(--text-secondary);
}

.threshold-row .value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: inherit;
}

.text-success { color: #10b981 !important; }
.text-danger { color: #ef4444 !important; }

/* 响应式调整 */
@media (max-width: 640px) {
    body {
        padding: 0.5rem;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Prevent iOS text zoom */
    .form-group input,
    .form-group select {
        font-size: 16px;
    }

    .pair-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pair-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-content {
        width: 95%;
    }
}

.threshold-row.triggered-row .label, .threshold-row.triggered-row .value { color: #059669; font-weight: 700; }
