/* 日历CSS样式 */
.weather-calendar {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.weather-calendar th {
    background-color: #f2f2f2;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    font-weight: bold;
}

.weather-calendar td {
    padding: 15px 10px;
    text-align: center;
    border: 1px solid #ddd;
    vertical-align: top;
    min-height: 120px;
}

.weather-calendar .day-cell {
    width: 14.28%;
    /* 7 days a week */
}

.weather-calendar .other-month {
    background-color: #f9f9f9;
    color: #ccc;
}

.weather-calendar .date {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.weather-calendar .weather-icon {
    margin: 5px auto;
    display: block;
    text-align: center;
}

.weather-calendar .weather-icon img {
    width: 40px;
    height: 40px;
    display: inline-block;
    margin: 0 auto;
}

.weather-calendar .temperature {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.weather-calendar .temp-min {
    color: #1e80ff;
}

.weather-calendar .temp-separator {
    color: #999;
}

.weather-calendar .temp-max {
    color: #ff6600;
}

.weather-calendar .sunrise-sunset {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

.weather-calendar .sunrise {
    color: #666;
}

.weather-calendar .sunset {
    color: #666;
}

.stats-module h2,
.map-module h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.stats-item {
    background-color: white;
    padding: 15px 5px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 100px;
}

.stats-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    margin-bottom: 5px;
}

.stats-label {
    font-size: 13px;
    color: #666;
    word-break: break-word;
    text-align: center;
}

.unit {
    font-size: 16px;
    font-weight: normal;
    color: #666;
}

.temp-unit {
    font-size: 16px;
    font-weight: normal;
    color: #666;
}

.weather-summary {
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #252933;
}

.weather-summary p {
    margin: 0;
    text-align: justify;
    font-size: 17px;
    line-height: 1.7;
}

/* 天气详情表格样式 */
.weather-details {
    margin: 20px 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 字段选择器样式 */
.field-selector {
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

.field-selector h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.field-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.field-options label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.field-options input[type="checkbox"] {
    margin-right: 5px;
}

/* 天气详情表格容器样式 */
.weather-table-container {
    overflow-x: auto;
}

/* 天气详情表格样式 */
.weather-table {
    display: inline-table;
    table-layout: auto;
    width: max-content;
    min-width: unset;
}

.weather-table-header {
    display: flex;
    background-color: #f2f2f2;
    font-weight: bold;
    border-bottom: 1px solid #e0e0e0;
}

.weather-table-row {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.weather-table-row:hover {
    background-color: #f9f9f9;
}

/* 表格列样式 */
.table-column {
    padding: 15px;
    text-align: center;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-column {
    width: auto;
    font-weight: bold;
    min-width: 100px;
}

.weather-column {
    width: 150px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-icon {
    width: 40px;
    height: 40px;
}

.weather-text {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 列宽调整手柄样式 */
.table-column {
    position: relative;
    user-select: none;
}

.column-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background-color: transparent;
    cursor: col-resize;
    transition: background-color 0.2s ease;
    z-index: 10;
}

.column-resizer:hover {
    background-color: #1e80ff;
}

.column-resizer:active {
    background-color: #1860d4;
    cursor: col-resize;
}

.temperature-column {
    width: 260px;
}

.wind-speed-column {
    width: 120px;
}

.wind-direction-column {
    width: 80px;
}

.apparent-temperature-column {
    width: 150px;
}

.precipitation-column {
    width: 100px;
}

.snowfall-column {
    width: 100px;
}

.sunshine-column {
    width: 120px;
}

.radiation-column {
    width: 150px;
}

.et0-column {
    width: 180px;
}

/* 温度条样式 */
.temperature-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 250px;
}

.temperature-bar {
    flex: 1;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.temperature-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e80ff;
    opacity: 0.13;
    border-radius: 5px;
}

.temperature-current {
    position: absolute;
    top: 0;
    height: 100%;
    background-color: #1e80ff;
    border-radius: 5px;
}

.temp-min,
.temp-max {
    font-size: 14px;
    font-weight: bold;
    min-width: 50px;
}

.temp-min {
    color: #1e80ff;
}

.temp-max {
    color: #ff6600;
}

/* 风向箭头样式 */
.wind-arrow {
    width: 24px;
    height: 24px;
    font-size: 20px;
    line-height: 24px;
    text-align: center;
    color: #333;
    margin: 0 auto;
    transform-origin: center center;
}

/* 隐藏字段的样式 */
.table-column.hidden {
    display: none;
}

/* 附近地区天气样式 */
.main-content-box h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.nearby-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nearby-city-item {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f2f2f2;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.nearby-city-item:hover {
    background-color: #e0e0e0;
    color: #1e80ff;
}

.nearby-city-item:active {
    background-color: #d0d0d0;
}

.nearby-city-item:visited {
    color: #666;
}

.map-module p {
    font-size: 13px;
    color: #AAA;
    line-height: 1.6;
    margin-top: 10px;
}

/* 月份导航样式 */
.choose-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.month-navigation {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
    justify-content: flex-start;
}

.month-link {
    font-size: 14px;
    color: #1e80ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.month-link:hover {
    color: #1860d4;
    text-decoration: underline;
}

.month-separator {
    color: #999;
    font-size: 14px;
}

/* 日历链接样式 */
.day-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 5px 0;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.day-link:hover {
    background-color: rgba(49, 113, 242, 0.1);
}

.day-link:active {
    background-color: rgba(49, 113, 242, 0.2);
}

/* 表格日期链接样式 */
.table-day-link {
    color: #1e80ff;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: bold;
}

.table-day-link:hover {
    color: #1860d4;
    text-decoration: underline;
}

.table-day-link:active {
    color: #0f48a0;
}

/* 响应式样式 */
@media (max-width: 1240px) {
    .weather-calendar td {
        padding: 10px 5px;
    }
    
    .weather-calendar .weather-icon img {
        width: 35px;
        height: 35px;
    }
    
    .weather-calendar .temperature {
        font-size: 13px;
    }
    
    .weather-calendar .sunrise-sunset {
        font-size: 11px;
    }
    
    .stats-grid {
        gap: 15px;
    }
    
    .stats-item {
        min-width: 90px;
        padding: 12px 5px;
    }
    
    .stats-value {
        font-size: 20px;
    }
}

@media (max-width: 1024px) {
    .weather-calendar td {
        padding: 8px 3px;
    }
    
    .weather-calendar .weather-icon img {
        width: 30px;
        height: 30px;
    }
    
    .weather-calendar .temperature {
        font-size: 12px;
    }
    
    .weather-calendar .sunrise-sunset {
        font-size: 10px;
    }
    
    .weather-summary p {
        font-size: 15px;
    }
    
    .stats-module h2,
    .map-module h2 {
        font-size: 16px;
    }
    
    .stats-grid {
        gap: 10px;
    }
    
    .stats-item {
        min-width: 80px;
        padding: 10px 5px;
    }
    
    .stats-value {
        font-size: 18px;
    }
    
    .stats-label {
        font-size: 12px;
    }
    
    .field-options {
        gap: 10px;
    }
    
    .field-options label {
        font-size: 13px;
    }
    
    .nearby-cities {
        gap: 8px;
    }
    
    .nearby-city-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .weather-calendar {
        font-size: 13px;
    }
    
    .weather-calendar th,
    .weather-calendar td {
        padding: 5px 2px;
    }
    
    .weather-calendar .day-cell {
        min-height: auto;
    }
    
    .weather-calendar .date {
        font-size: 12px;
        margin-bottom: 3px;
    }
    
    .weather-calendar .weather-icon {
        margin: 3px auto;
    }
    
    .weather-calendar .weather-icon img {
        width: 25px;
        height: 25px;
    }
    
    .weather-calendar .temperature {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    .weather-calendar .sunrise-sunset {
        font-size: 9px;
        line-height: 1.2;
    }
    
    .weather-summary p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .weather-details {
        margin: 15px 0;
    }
    
    .field-selector {
        padding: 12px;
    }
    
    .field-selector h3 {
        font-size: 15px;
    }
    
    .field-options {
        gap: 8px;
    }
    
    .field-options label {
        font-size: 12px;
    }
    
    .table-column {
        padding: 10px 5px;
        font-size: 13px;
    }
    
    .date-column {
        width: auto;
    }
    
    .weather-column {
        width: 120px;
    }
    
    .temperature-column {
        width: 200px;
    }
    
    .temperature-bar-container {
        width: 190px;
        gap: 5px;
    }
    
    .weather-icon {
        width: 30px;
        height: 30px;
    }
    
    .weather-text {
        font-size: 12px;
    }
    
    .wind-speed-column,
    .precipitation-column,
    .snowfall-column,
    .sunshine-column {
        width: 90px;
    }
    
    .wind-direction-column {
        width: 60px;
    }
    
    .apparent-temperature-column,
    .radiation-column {
        width: 120px;
    }
    
    .et0-column {
        width: 150px;
    }
    
    .temp-min,
    .temp-max {
        font-size: 13px;
        min-width: 40px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-item {
        min-width: auto;
        padding: 15px;
    }
    
    .nearby-cities {
        gap: 6px;
    }
    
    .nearby-city-item {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .map-module iframe {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .weather-calendar {
        font-size: 12px;
    }
    
    .weather-calendar th,
    .weather-calendar td {
        padding: 3px 2px;
    }
    
    .weather-calendar .date {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .weather-calendar .weather-icon img {
        width: 20px;
        height: 20px;
    }
    
    .weather-calendar .temperature {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .weather-calendar .sunrise-sunset {
        font-size: 9px;
        line-height: 1.1;
    }
    
    .weather-summary p {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .field-selector {
        padding: 10px;
    }
    
    .field-options {
        gap: 6px;
    }
    
    .field-options label {
        font-size: 11px;
    }
    
    .table-column {
        padding: 8px 3px;
        font-size: 12px;
    }
    
    .date-column {
        width: auto;
    }
    
    .weather-column {
        width: 100px;
    }
    
    .temperature-column {
        width: 180px;
    }
    
    .temperature-bar-container {
        width: 170px;
        gap: 5px;
    }
    
    .weather-icon {
        width: 25px;
        height: 25px;
    }
    
    .weather-text {
        font-size: 11px;
    }
    
    .wind-speed-column,
    .precipitation-column,
    .snowfall-column,
    .sunshine-column {
        width: 80px;
    }
    
    .wind-direction-column {
        width: 50px;
    }
    
    .apparent-temperature-column,
    .radiation-column {
        width: 100px;
    }
    
    .et0-column {
        width: 120px;
    }
    
    .temp-min,
    .temp-max {
        font-size: 12px;
        min-width: 35px;
    }
    
    .wind-arrow {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stats-item {
        padding: 12px;
    }
    
    .stats-value {
        font-size: 16px;
    }
    
    .stats-label {
        font-size: 11px;
    }
    
    .nearby-cities {
        gap: 5px;
    }
    
    .nearby-city-item {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .map-module iframe {
        height: 200px;
    }
}

/* Temperature Unit Switching */
.temp-values {
    position: relative;
    display: inline-block;
}

/* Hide all temperature values by default */
.temp-celsius, .temp-fahrenheit {
    display: none;
    transition: opacity 0.3s ease;
}

/* Show active temperature values */
.temp-celsius.active, .temp-fahrenheit.active {
    display: inline;
    opacity: 1;
}

/* Stats module temperature display */
.stats-value.temp-low, .stats-value.temp-high {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-value .temp-value {
    margin: 0 4px;
}

/* Temperature bar container */
.temperature-bar-container .temp-values {
    display: block;
    text-align: center;
}

/* Table temperature display */
.table-column .temp-values {
    display: block;
    text-align: center;
}

/* Temp values container for table display */
.temp-values {
    text-align: center;
}

/* Wind Speed Unit Switching */
.wind-speed {
    display: none;
    transition: opacity 0.3s ease;
}

.wind-speed.active {
    display: inline;
    opacity: 1;
}

/* Unit selector styles */
.unit-selector {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

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

.unit-select-container {
    display: inline-block;
}

.wind-speed-unit-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.wind-speed-unit-select:focus {
    outline: none;
    border-color: #1e80ff;
    box-shadow: 0 0 0 2px rgba(30, 128, 255, 0.1);
}