/* 现代化变量系统 */
:root {
    --primary: #ff6b35;
    --primary-light: #ff8c61;
    --primary-dark: #e55a2b;
    --secondary: #1e3a8a;
    --accent: #06d6a0;
    --gradient: linear-gradient(135deg, #ff6b35 0%, #ff8c61 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-glass: rgba(255, 255, 255, 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰元素 */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.bg-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
}

.bg-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -100px;
    right: -100px;
}

/* 主要容器 */
.converter-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 500px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.converter-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* 装饰边框 */
.decorative-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
}

/* Report Header Styles - Shared between records.php and payins.php */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0;
}

.report-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    margin: 0;
    background: linear-gradient(135deg, var(--primary), #e65c2e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.home-link-button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.home-link-button:hover {
    transform: scale(1.1);
    background: white;
    color: var(--primary);
}

.export-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.export-btn:hover {
    transform: scale(1.1);
    background: white;
    color: var(--primary);
}

/* Records Container - Shared between records.php and payins.php */
.records-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    /*padding: 20px;*/
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    width: 100%;
    /*max-width: 800px;*/
    margin-top: 0;
    /*margin: 0 10px;*/
}

/* Total Summary Single - Shared between records.php and payins.php */
.total-summary-single {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    text-align: center;
}

.summary-item .label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
}

.summary-item .value {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.summary-item-total .value {
    color: #22c55e; /* Green for total amount */
}

.summary-separator {
    width: 1px;
    background-color: #e2e8f0;
}

/* Date Navigation Wrapper - Mobile Responsive */
.date-navigation-wrapper {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
    width: 100%;
    box-sizing: border-box;
}

.date-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.search-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    min-width: 120px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    min-width: 100px;
    flex: 1;
}

.nav-btn,
.today-action-btn,
.search-btn {
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-btn:hover,
.today-action-btn:hover,
.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 标题区域 */
.header-section {
    text-align: center;
    margin-bottom: 10px;
    position: relative;
}

.flag-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
}

/* 输入区域 */
.input-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 2px solid rgba(255, 107, 53, 0.1);
    transition: border-color 0.3s ease;
}

.input-section:focus-within {
    border-color: var(--primary);
}

.input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.label-left {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-left i {
    color: var(--primary);
}

.label-right {
    font-size: 12px;
    color: var(--text-light);
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    border: 1px solid transparent;
    padding-left: 12px;
    overflow: hidden; /* Clip child corners */
}

.input-wrapper:focus-within {
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.6);
}

.input-wrapper:focus-within .currency-symbol i {
    color: #f97316;
}

.currency-symbol {
    color: #b6b6b6;
    font-size: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}

.currency-symbol i {
    transition: color 0.2s ease;
}

#mxn-input {
    flex: 1 1 auto;
    border: none;
    background: transparent;
    outline: none !important;
    box-shadow: none !important;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 16px 0;
    width: 100%;
}


#mxn-input::-webkit-outer-spin-button,
#mxn-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#mxn-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

/* 货币代码标签 */
.currency-code {
    position: absolute;
    right: 75px; /* 按钮宽度120px + 20px间距 */
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 2;
}

/* 3%计算区域 */
.three-percent-section {
    padding: 10px 16px;
    background-color: #f7fafc; /* 柔和的灰色背景 */
    border-radius: 12px; /* 圆角 */
    border: 1px solid #e2e8f0; /* 浅灰色边框 */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/*.percent-badge {*/
/*    !* 再次调浅：更明亮的灰蓝色，接近中灰色调 *!*/
/*    background: rgba(55, 65, 85, 0.9);*/
/*    !* 字体颜色微调，保持最佳可读性 *!*/
/*    color: #f0f4f9;*/
/*    padding: 6px 16px;*/
/*    border-radius: var(--radius-sm);*/
/*    font-size: 14px;*/
/*    font-weight: 700;*/
/*    display: flex;*/
/*    align-items: baseline;*/
/*    !* 边框相应调浅以匹配 *!*/
/*    !*border: 1px solid rgba(255, 255, 255, 0.15);*!*/
/*}*/


.percent-badge {
    /* 浅灰色背景 */
    background: rgba(240, 240, 240, 0.95);
    /* 深黑色文字 */
    color: #222222;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: baseline;
}

.three-percent-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.currency-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 4px;
}

/* 主要按钮 */
.convert-button {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    height: 44px; /* 设置固定高度 */
    width: 80px; /* 固定宽度 */
    padding: 0 10px; /* 移除垂直内边距 */
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* 添加间距 */
}

.convert-button:hover {
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4); /* More pronounced shadow on hover */
}

.convert-button:active {
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3); /* 恢复部分阴影 */
}

/* 主操作按钮容器 */
.main-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* 刷新按钮靠右 */
    gap: 16px;
    margin-bottom: 32px; /* 恢复下边距 */
}

.page-refresh-button {
    margin-left: auto; /* 将刷新按钮推到最右边 */
}

/* 页面刷新按钮 - 渐变图标风格 */
.page-refresh-button {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    background: transparent; /* 透明背景 */
    border: 1px solid var(--glass-border); /* 纤细的玻璃质感边框 */
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.page-refresh-button:hover {
    background: rgba(255, 107, 53, 0.1); /* 悬停时浮现淡橙色背景 */
    transform: rotate(360deg); /* 保留旋转动画 */
}

.page-refresh-button:active {
    background: rgba(255, 107, 53, 0.2); /* 点击时背景加深 */
    transform: scale(0.95) rotate(360deg); /* 增加一个轻微的缩放反馈 */
    transition-duration: 0.1s;
}

.page-refresh-button i {
    font-size: 24px; /* 稍微增大图标，使其更突出 */
    background: linear-gradient(135deg, var(--primary-light), var(--primary)); /* 应用主按钮的渐变 */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent; /* Fallback */
    transition: transform 0.3s ease;
}

.convert-button i {
    margin-right: 12px;
    transition: transform 0.3s ease;
}

.convert-button:hover i {
    transform: rotate(15deg);
}

.view-records-button {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    margin-top: 24px; /* This is overridden for buttons in the flex container */
    box-shadow: 0 4px 20px rgba(6, 214, 160, 0.3);
}

.footer-buttons {
    display: flex;
    gap: 16px;
    margin-top: 18px;
}

.footer-buttons .view-records-button {
    margin-top: 0;
}

.view-records-button:hover {
    transform: translateY(-2px);
    background: #05b388; /* A slightly darker accent color for hover */
    box-shadow: 0 8px 30px rgba(6, 214, 160, 0.4);
}

.view-records-button[href="report.php"] {
    background: #3b82f6; /* A nice blue shade */
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.view-records-button[href="report.php"]:hover {
    background: #2563eb; /* A darker blue for hover */
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

/* 图片记录按钮样式 - 紫色主题 */
.view-records-button[href="payins.php"] {
    background: #8b5cf6; /* A nice purple shade */
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.view-records-button[href="payins.php"]:hover {
    background: #7c3aed; /* A darker purple for hover */
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

/* OCR错误按钮样式 - 橙色主题 */
.view-records-button[href="ocr_err.php"] {
    background: #f97316; /* A nice orange shade */
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
}

.view-records-button[href="ocr_err.php"]:hover {
    background: #ea580c; /* A darker orange for hover */
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.4);
}

.view-records-button i {
    margin-right: 10px;
}


/* 结果区域 */
.results-section {
    margin-top: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.results-section.show {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /*margin-bottom: 2px;*/
}

.section-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.refresh-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    color: var(--primary);
    background: rgba(255, 107, 53, 0.1);
}

/* 货币卡片 */
.currency-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 2px;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.currency-card:hover {
    transform: translateX(8px);
    border-color: rgba(255, 107, 53, 0.2);
    box-shadow: var(--shadow-md);
}

.records-table-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.records-table .row-lowest,
.records-table .row-highest {
    position: relative;
    font-weight: bold;
}

/* The pseudo-element will be the background, so hide the cell's own background */
.records-table tbody .row-lowest td,
.records-table tbody .row-highest td {
    background-color: transparent !important;
    border-bottom-color: transparent; /* Hide the line separator for a cleaner look */
}

/* Create the background element */
.records-table .row-lowest::after,
.records-table .row-highest::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px; /* Increased radius */
    z-index: -1;
}

.records-table .row-lowest::after {
    background-color: #ffeeea; /* 柔和的玫瑰粉 */
}

.records-table .row-highest::after {
    background-color: #fef9c3; /* 淡雅的金色 */
}

/* Ensure the tr background is transparent to show the pseudo-element */
.records-table .row-lowest,
.records-table .row-highest,
.records-table .row-lowest:nth-child(odd),
.records-table .row-highest:nth-child(odd),
.records-table .row-lowest:hover,
.records-table .row-highest:hover {
    background-color: transparent !important;
}

.diff-tag {
    display: inline-block;
    padding: 6px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.2;
    /*margin-left: 2px;*/
}

.diff-tag.diff-short {
    background-color: #f0fdf4;
    color: #15803d;
}

.diff-tag.diff-medium {
    background-color: #fef9c3;
    color: #854d0e;
}

.diff-tag.diff-long {
    background-color: #fff1f2;
    color: #991b1b;
}

.diff-tag.diff-neutral {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* Back to Top Button */
#back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s ease-in-out;
    z-index: 1000;
}

#back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.currency-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient);
}

.currency-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.currency-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(30, 58, 138, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.currency-details h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.currency-details .rate {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    margin: 0;
}


.currency-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.currency-amount.usd {
    color: #10b981;
}

.currency-amount.cny {
    color: #ef4444;
}

/* 底部信息 */
.footer-info {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.settings-link {
    display: block;
    margin-top: 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.settings-link:hover {
    color: var(--primary);
    text-decoration: underline;
}


.api-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-light);
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 错误提示 */
.error-message {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-message i {
    font-size: 18px;
}

/* 成功状态 */
.today-total-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #047857;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 640px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .converter-container {
        padding: 20px;
        border-radius: var(--radius-lg);
        width: 100%;
        max-width: none;
        box-shadow: var(--shadow-md);
    }

    .header-section {
        margin-bottom: 0px;
    }

    .flag-icon {
        font-size: 40px;
    }

    h1 {
        font-size: 22px;
    }

    .subtitle {
        font-size: 13px;
    }

    .convert-button {
        width: 80px; /* 移动端调整宽度 */
        height: 44px; /* 移动端同样设置固定高度 */
    }

    .input-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    .input-wrapper {
        /* height: 64px; */ /* 移除高度设置 */
    }

    #mxn-input {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        height: auto !important;
        padding-left: 60px;
        padding-right: 90px;
    }

    .footer-buttons {
        padding: 0 10px;
        flex-direction: row; /* 改为水平排列 */
        gap: 12px;

    }

    .section-title h2 {
        font-size: 16px;
    }

    .refresh-btn {
        font-size: 13px;
        padding: 6px 10px;
    }

    .currency-card {
        padding: 8px 16px;
        display: flex; /* 确保是 flex 容器 */
        align-items: center; /* 垂直居中 */
        gap: 12px;
    }

    .currency-info {
        flex: 1; /* 占据所有可用空间 */
        min-width: 0; /* 允许收缩 */
    }

    .currency-amount {
        font-size: 22px;
        flex-shrink: 0; /* 防止金额被压缩 */
    }

    .chart-section {
        margin-top: 0px;
    }

    .chart-container {
        position: relative;
        height: auto;
        /*padding: 16px;*/
    }

    .daily-change-section {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .change-badge {
        font-size: 13px;
    }
}

/* 通用表单样式 */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    height: 50px; /* 设置与按钮相同的高度 */
    padding: 10px 210px 10px 20px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    background: #f8fafc;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

/* settings.php specific styles */
.form-group-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.form-group-row .label-group {
    display: flex;
    flex-direction: column;
}

.form-group-row .label-group .description {
    font-size: 13px;
    color: #a0aec0;
    margin-top: 4px;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3e4c5b;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
    color: var(--primary);
}

/* Maintenance Mode Styles */
.converter-container.maintenance-mode {
    padding-top: 50px;
    padding-bottom: 50px;
}

.maintenance-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: block;
    text-align: center;
}

.admin-login-link {
    display: inline-block;
    margin-top: 25px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.admin-login-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* Login Page Error Message */
.error-message-container {
    display: flex;
    align-items: center;
    background-color: #ffebee;
    border: 1px solid #e57373;
    border-left: 5px solid #f44336;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    animation: shake 0.5s;
}

.error-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    color: #f44336;
}

.error-text strong {
    color: #c62828;
    font-weight: 600;
}

.error-text span {
    display: block;
    margin-top: 2px;
    font-size: 0.9rem;
    color: #212121;
}

.login-form {
    margin-top: 10px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@media (max-width: 480px) {
    .records-container {
        padding: 15px 10px 0;
        border-radius: var(--radius-lg);
        max-width: none;
        width: 100%;
    }
    
    .date-navigation-wrapper {
        padding: 8px 6px;
        margin-bottom: 12px;
    }
    
    .date-navigation {
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .search-wrapper {
        gap: 6px;
    }
    
    .date-input {
        min-width: 100px;
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .search-input {
        min-width: 80px;
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .nav-btn,
    .today-action-btn,
    .search-btn {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .report-header {
        margin-bottom: 16px;
    }
    
    .report-header h1 {
        font-size: 24px;
    }
    
    .home-link-button,
    .export-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .total-summary-single {
        padding: 0 8px;
        margin-bottom: 16px;
    }
    
    .summary-item {
        padding: 6px 8px;
    }
    
    .summary-item .label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .summary-item .value {
        font-size: 18px;
    }

    .footer-buttons {
        display: flex;
        justify-content: space-around; /* 改为均匀分布 */
        gap: 6px; /* 进一步减小间距 */
        align-items: center;
        flex-wrap: nowrap; /* 防止换行 */
        padding: 0 10px; /* 添加内边距 */
    }

    .footer-buttons .view-records-button,
    .footer-buttons .report-button,
    .footer-buttons .images-button,
    .footer-buttons .ocr-error-button {
        width: 23%; /* 调整为23%宽度，4个按钮 */
        text-align: center;
        padding: 8px 4px; /* 减小padding，降低高度 */
        font-size: 12px; /* 减小字体大小 */
        flex-shrink: 0; /* 防止按钮被压缩 */
        margin: 0 1px; /* 减小边距 */
        min-width: 0; /* 允许收缩 */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px; /* 减小间距 */
    }

    .footer-buttons .view-records-button i,
    .footer-buttons .report-button i,
    .footer-buttons .images-button i,
    .footer-buttons .ocr-error-button i {
        margin-right: 0;
        margin-bottom: 1px; /* 减小图标与文字的间距 */
        font-size: 16px; /* 增大图标 */
    }

    .footer-buttons .view-records-button span,
    .footer-buttons .report-button span,
    .footer-buttons .images-button span,
    .footer-buttons .ocr-error-button span {
        font-size: 11px; /* 减小文字 */
        line-height: 1;
    }

    .convert-button, .page-refresh-button {
        /* width: 100% and associated padding/margin are removed */
        height: 60px; /* 统一高度 */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .convert-button span {
        margin-left: 10px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .footer-buttons {
        gap: 8px;
        padding: 0 5px;
    }

    .footer-buttons .view-records-button,
    .footer-buttons .report-button,
    .footer-buttons .images-button,
    .footer-buttons .ocr-error-button {
        width: 22%; /* 更小宽度 */
        padding: 6px 2px; /* 进一步减小padding，降低高度 */
        font-size: 10px;
    }

    .footer-buttons .view-records-button i,
    .footer-buttons .report-button i,
    .footer-buttons .images-button i,
    .footer-buttons .ocr-error-button i {
        font-size: 14px; /* 减小图标 */
    }

    .footer-buttons .view-records-button span,
    .footer-buttons .report-button span,
    .footer-buttons .images-button span,
    .footer-buttons .ocr-error-button span {
        font-size: 9px; /* 更小文字 */
    }
}

/* records.php - Today's Date Display */
.today-date-display {
    display: flex;
    align-items: center;
    background-color: rgba(255, 107, 53, 0.1); /* 使用主色的淡淡的背景 */
    border: 1px solid rgba(255, 107, 53, 0.2); /* 匹配背景色的边框 */
    border-radius: 22px; /* 胶囊形状 */
    padding: 8px 16px;
    font-weight: 600;
    color: var(--primary); /* 使用主色作为文字和图标颜色 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-right: 12px; /* 与日期输入框的间距 */
}

.today-date-display i {
    font-size: 20px; /* 增大图标 */
    margin-right: 10px;
}

.today-date-display span {
    font-size: 20px; /* 增大数字 */
}

/*    text-decoration: underline;*/
/*    transform: translateY(-2px);*/
/*}*/

.back-link:active {
    color: var(--primary-dark);
    transform: translateY(0);
    transition-duration: 0.05s;
}

.message.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    color: #047857;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.message.success i {
    font-size: 18px;
}

/* 加载动画 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 昨日对比 */
.daily-change-section {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.5s ease-in-out;
}

.daily-change-section.hidden {
    display: none;
}

.change-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.change-badge.positive {
    background: var(--accent);
}

.change-badge.negative {
    background: #ef4444;
}

.change-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 图表区域 */
.chart-section {
    margin-top: 6px;
    animation: fadeIn 0.5s ease-in-out 0.2s;
    animation-fill-mode: backwards; /* Start animation even if delayed */
}

/* 重建的转换按钮样式 - 仅包含视觉样式，无动画 */
.convert-button-rebuilt {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    width: 60px;
    padding: 0 10px;
    margin-right: 10px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out; /* 添加过渡动画 */
}

.convert-button-rebuilt:hover {
    transform: translateY(-50%) translateY(-2px); /* 悬浮时上移 */
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4); /* 阴影变大 */
}

.convert-button-rebuilt:active {
    transform: translateY(-50%) translateY(0px); /* 点击时下沉 */
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3); /* 阴影变小 */
}

/* Summary Item Styles */
.summary-item .label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.summary-item .value {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1.2;
            transition: font-size 0.2s ease-in-out;
            display: block;
        }