/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #F5F5F5;
    color: #333;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ===== 应用容器 ===== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px 32px;
    min-height: 100vh;
    position: relative;
    background: #F5F5F5;
    box-shadow: 0 0 20px rgba(0,0,0,0.04);
}

/* ===== 头部 ===== */
.app-header {
    margin-bottom: 24px;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: #222;
    flex: 1;
}

.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #888;
    font-weight: 500;
    letter-spacing: 1px;
}

.icon-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.icon-btn:active {
    transform: scale(0.95);
}

.reminder-text {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== 区块 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

/* ===== 汇率卡片 ===== */
.rate-card {
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid transparent;
}

.rate-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.rate-card[data-source="Jags Money"] {
    border-left-color: #2E7D32;
}

.rate-card[data-source="Money Master"] {
    border-left-color: #1565C0;
}

.rate-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rate-source {
    font-size: 14px;
    font-weight: 700;
}

.rate-card[data-source="Jags Money"] .rate-source {
    color: #2E7D32;
}

.rate-card[data-source="Money Master"] .rate-source {
    color: #1565C0;
}

.rate-badge {
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.rate-main {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.4;
}

.rate-sub {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== 按钮 ===== */
.btn {
    border: none;
    border-radius: 28px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-primary {
    background: #FF9800;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-primary:hover {
    background: #FB8C00;
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

.btn-secondary {
    background: #4CAF50;
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary:hover {
    background: #43A047;
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.btn-text {
    background: transparent;
    color: #666;
}

.btn-text:hover {
    background: rgba(0,0,0,0.05);
}

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

.btn-mini {
    border: none;
    background: #2196F3;
    color: white;
    border-radius: 18px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-mini:active {
    transform: scale(0.95);
}

.btn-chart {
    background: #2196F3;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

/* ===== 状态文本 ===== */
.status-text {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #999;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
}

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

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 28px 24px;
    width: 100%;
    max-width: 360px;
    animation: slideUp 0.3s;
}

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

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 4px;
    color: #333;
}

.modal-hint {
    font-size: 12px;
    color: #999;
    margin-bottom: 20px;
}

.time-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 28px;
}

.time-picker input {
    width: 80px;
    height: 60px;
    font-size: 32px;
    text-align: center;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #333;
    background: #FAFAFA;
    transition: all 0.2s;
    -moz-appearance: textfield;
}

.time-picker input::-webkit-outer-spin-button,
.time-picker input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-picker input:focus {
    outline: none;
    border-color: #FF9800;
    background: white;
}

.time-separator {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 8px;
}

.modal-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
}

/* ===== 加载动画 ===== */
.loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #FF9800;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

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

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 2000;
    animation: toastShow 0.3s;
    pointer-events: none;
}

@keyframes toastShow {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
