/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #334155;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 主要内容 */
.main {
    padding: 2rem 0;
}

/* 地区选择 */
.region-selector {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.region-selector h2 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.25rem;
}

.region-select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    width: 100%; /* Make select full width */
}

.region-select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* 输入区域 */
.input-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Adjusted min-width and added more columns */
    gap: 0.75rem; /* Reduced gap for tighter layout */
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.input-group input[type="number"],
.input-group input[type="text"],
.input-group select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    width: 100%; /* Ensure inputs take full width of their group */
}

.input-group input[type="number"]:focus,
.input-group input[type="text"]:focus,
.input-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* 结果展示 */
.results-section {
    margin-bottom: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-card h3 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.25rem;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.results-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.results-table td {
    color: #6b7280;
}

.results-table .amount {
    font-weight: 600;
    color: #059669;
}

.results-table .rate {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* 汇总信息 */
.summary-grid {
    display: grid;
    gap: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.summary-item.highlight {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.summary-item .label {
    font-weight: 500;
}

.summary-item .value {
    font-weight: 700;
    font-size: 1.1rem;
}

.summary-item.highlight .value {
    font-size: 1.25rem;
}

/* 图表区域 */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: #1e293b;
    text-align: center;
}

.chart-container canvas {
    max-height: 300px;
}

/* 底部 */
.footer {
    background: #1e293b;
    color: #94a3b8;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* 动画效果 */
.result-card,
.region-btn,
.nav-link {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

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

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





/* 交流社群导航项样式 */
.nav-item-community {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-item-community .nav-link {
    padding-right: 1rem; /* Adjust padding to make space for potential icon */
}

.community-qr-code {
    position: absolute;
    top: 100%; /* Position below the nav link */
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    width: 150px; /* Adjust as needed */
    text-align: center;
}

.community-qr-code img {
    width: 100%;
    height: auto;
    display: block;
}

.nav-item-community:hover .community-qr-code {
    opacity: 1;
    visibility: visible;
}


