body {
    font-family: Arial, sans-serif;
    margin: 20px;
    padding: 0;
    background-color: #fff;
}

/* 登录表单样式 */
#login-form {
    max-width: 400px;
    margin: 20px auto;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#login-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px; /* 增大字体以便触摸 */
    box-sizing: border-box;
}

.password-field-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    font-size: 16px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-container input {
    flex: 1;
}

.captcha-img {
    width: 100px;
    height: 40px; /* 增加高度 */
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    line-height: 40px; /* 调整行高 */
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    font-size: 16px; /* 增大字体 */
}

.login-btn {
    width: 100%;
    padding: 15px; /* 增加内边距 */
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px; /* 增大字体 */
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.login-btn:hover {
    background-color: #45a049;
}

.change-password-link {
    text-align: center;
    margin-top: 15px;
    font-size: 16px; /* 增大字体 */
}

.change-password-link a {
    color: #2196F3;
    text-decoration: none;
    cursor: pointer;
}

.change-password-link a:hover {
    text-decoration: underline;
}

/* 修改密码表单样式 */
#change-password-form, #settings-form {
    max-width: 400px;
    margin: 20px auto; /* 调整外边距 */
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: none;
}

#change-password-form h2, #settings-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.back-link {
    text-align: center;
    margin-top: 15px;
    font-size: 16px; /* 增大字体 */
}

.back-link a {
    color: #2196F3;
    text-decoration: none;
    cursor: pointer;
}

.error-message {
    color: red;
    font-size: 16px; /* 增大字体 */
    margin-top: 10px;
    text-align: center;
}

.success-message {
    color: green;
    font-size: 16px; /* 增大字体 */
    margin-top: 10px;
    text-align: center;
}

/* 主要内容区域样式 */
#main-content {
    display: none;
}

.top-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px; /* 增加内边距 */
    background-color: #f5f5f5;
    border-radius: 5px;
}

.selectors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.area-selector select {
    padding: 12px; /* 增加内边距 */
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    font-size: 16px; /* 增大字体 */
    min-width: 120px; /* 增加最小宽度 */
}

.time-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.time-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.time-type-options label {
    white-space: nowrap;
    margin-right: 15px; /* 调整间距 */
    display: flex;
    align-items: center;
    gap: 5px; /* 输入框和文字之间的间距 */
}

.time-type-options input[type="radio"] {
    margin: 0;
}

.time-date-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.time-date-container label {
    margin: 0 10px 0 0;
}

.time-date-container input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.time-date-container input[type="datetime-local"] {
    width: auto;
}

.time-date-container input[type="month"] {
    width: auto;
}

.time-date-container input[type="number"] {
    width: 100px;
}

@media screen and (max-width: 768px) {
    .time-type-options {
        flex-direction: column;
    }

    .time-type-options label {
        margin-bottom: 10px;
        margin-right: 0;
    }
}

@media screen and (min-width: 769px) {
    .time-type-options {
        flex-direction: row;
    }
}

@media screen and (min-width: 1024px) {
    .time-type-options {
        gap: 30px;
    }
}

.time-selector input {
    padding: 12px; /* 增加内边距 */
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    font-size: 16px; /* 增大字体 */
    width: 100%;
    max-width: 200px; /* 设置最大宽度 */
}

@media screen and (max-width: 768px) {
    .time-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .time-type-options {
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 10px;
    }

    .time-type-options label {
        display: block;
        margin-bottom: 5px;
    }

    .time-selector input {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .time-type-options {
        flex-direction: column;
    }

    .time-type-options label {
        margin-bottom: 10px;
    }
}

.time-selector label {
    color: #333;
    font-weight: bold;
    font-size: 16px; /* 增大字体 */
}

.controls {
    margin: 0;
    text-align: right;
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* 增加间隙 */
    justify-content: flex-end;
}

.controls button:last-child {
    margin-right: 0;
}

button {
    padding: 12px 15px; /* 增加内边距 */
    margin-left: 10px;
    cursor: pointer;
    background: linear-gradient(to bottom, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
    font-size: 16px; /* 增大字体 */
}

button:hover {
    background: linear-gradient(to bottom, #45a049, #4CAF50);
}

.change-pwd-btn {
    background: linear-gradient(to bottom, #2196F3, #1976D2);
}

.change-pwd-btn:hover {
    background: linear-gradient(to bottom, #1976D2, #2196F3);
}

.logout-btn {
    background: linear-gradient(to bottom, #f44336, #d32f2f);
}

.logout-btn:hover {
    background: linear-gradient(to bottom, #d32f2f, #f44336);
}

.header-container {
    text-align: center;
    margin-bottom: 20px;
}

.header-container h2 {
    font-size: 1.5rem;
    margin: 10px 0; /* 添加垂直外边距 */
}

.header-container h2.editable {
    outline: 2px dashed #ccc;
    outline-offset: 2px;
    border-radius: 4px;
    transition: outline 0.2s ease;
    cursor: text;
}

.header-container h2.editable:focus,
.header-container h2.editable.editing {
    outline: 2px solid #4CAF50;
    cursor: text;
}

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

.table-wrap {
    flex: 1;
    min-width: 300px;
}

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

th, td {
    border: 1px solid #ccc;
    padding: 12px; /* 增加内边距 */
    text-align: center;
    font-size: 16px; /* 增大字体 */
}

th {
    background: linear-gradient(to bottom, #4CAF50, #45a049);
    color: white;
    padding: 15px; /* 增加内边距 */
    font-weight: bold;
}

/* 右键菜单（用于隐藏/显示列） */
.context-menu {
    position: fixed;
    z-index: 20000;
    min-width: 160px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    padding: 6px 0;
    display: none;
}

.context-menu button {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #222;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.context-menu button:hover {
    background: rgba(76, 175, 80, 0.12);
}

/* 隐藏“市排名”整列（第2列） */
#pm25-table.hide-city-rank th:nth-child(2),
#pm25-table.hide-city-rank td:nth-child(2),
#tsp-table.hide-city-rank th:nth-child(2),
#tsp-table.hide-city-rank td:nth-child(2) {
    display: none;
}

/* 修改选中行的高亮样式，使用黄色背景 */
.highlighted-row {
    background-color: #ffff99 !important;
}

/* 隐藏元素用于截图时 */
.hidden-for-screenshot {
    display: none !important;
}

/* 移除了排名颜色标记 */
.avg-row {
    font-weight: bold;
}

.error {
    color: red;
}

.summary {
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    padding: 15px; /* 增加内边距 */
    background-color: #f9f9f9;
    border-radius: 4px;
    font-size: 16px; /* 增大字体 */
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    font-size: 16px; /* 增大字体 */
}

/* 添加遮罩层样式 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    body {
        margin: 10px;
        font-size: 16px; /* 设置基础字体大小 */
    }

    .top-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .selectors {
        flex-direction: column;
        align-items: stretch;
    }

    .time-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .time-selector input {
        width: 100%;
    }

    .controls {
        justify-content: center;
        margin-top: 10px;
    }

    .container {
        flex-direction: column;
    }

    .table-wrap {
        min-width: unset;
    }

    th, td {
        padding: 10px;
        font-size: 14px;
    }

    #login-form, #change-password-form, #settings-form {
        margin: 20px auto;
        padding: 20px;
    }

    .header-container h2 {
        font-size: 1.2rem;
    }

    /* 移动端优化 */
    .area-selector select,
    .time-selector input,
    .form-group input {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

@media screen and (max-width: 480px) {
    .captcha-container {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-img {
        width: 100%;
        margin-top: 10px;
        height: 50px;
        line-height: 50px;
    }

    button {
        padding: 12px 10px;
        margin: 5px;
        font-size: 16px;
        width: 100%;
    }

    .area-selector select {
        width: 100%;
    }

    .controls {
        flex-direction: column;
    }

    .top-controls {
        padding: 10px;
    }

    .header-container h2 {
        font-size: 1.1rem;
    }
}

/* 超小屏幕优化 */
@media screen and (max-width: 320px) {
    body {
        margin: 5px;
    }

    th, td {
        padding: 8px 4px;
        font-size: 12px;
    }

    .summary {
        padding: 10px 5px;
        font-size: 14px;
    }
}