/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f2f5;
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #1890ff;
}

/* 认证模式选择器样式 */
.auth-mode-selector {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.auth-mode-selector label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: #333;
}

.mode-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.mode-button {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #d9d9d9;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    position: relative;
}

.mode-button:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.mode-button.active {
    background-color: #1890ff;
    border-color: #1890ff;
    color: white;
}

.mode-button:disabled {
    background-color: #f5f5f5;
    border-color: #d9d9d9;
    color: #bfbfbf;
    cursor: not-allowed;
}

.mode-button .unavailable {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    opacity: 0.7;
}

.current-mode {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
    font-style: italic;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 1rem;
}

.login-button {
    width: 100%;
    padding: 0.75rem;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

.login-button:hover {
    background-color: #40a9ff;
}

.login-button:disabled {
    background-color: #bfbfbf;
    cursor: not-allowed;
}

.error-message {
    color: #f5222d;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    padding: 0.5rem;
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 4px;
}

.login-hint {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #8c8c8c;
}

/* 配置页面样式 */
.config-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background-color: #001529;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-controls {
    display: flex;
    align-items: center;
}

.logout-button {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 1rem;
}

.logout-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.config-container {
    display: flex;
    flex-direction: column;
    padding: 1rem 2rem;
    flex: 1;
}

.info-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
}

.avatar {
    width: 48px;
    height: 48px;
    background-color: #1890ff;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.user-details .username {
    font-weight: bold;
    font-size: 1.1rem;
}

.user-details .role {
    color: #8c8c8c;
    font-size: 0.9rem;
}

.ppa-estimates {
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    min-width: 250px;
}

.ppa-estimates h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #1890ff;
}

.ppa-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.ppa-metrics.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric .label {
    font-size: 0.8rem;
    color: #8c8c8c;
}

.metric .value {
    font-weight: bold;
    font-size: 1.1rem;
}

.last-update {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #8c8c8c;
    text-align: right;
}

.config-sections {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.section-tabs {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    background-color: #fafafa;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    border-bottom-color: #1890ff;
    color: #1890ff;
    font-weight: 500;
}

.section-content {
    padding: 1.5rem;
}

.config-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 1rem;
}

.range-value {
    margin-left: 0.5rem;
    font-weight: bold;
}

.action-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-button {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 1rem;
}

.save-button {
    background-color: #1890ff;
    color: white;
    border: none;
}

.save-button:hover {
    background-color: #40a9ff;
}

.export-button {
    background-color: #52c41a;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
    display: inline-block;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s;
}

.export-button:hover {
    background-color: #73d13d;
}

.import-button {
    background-color: #faad14;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
    display: inline-block;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s;
}

.import-button:hover {
    background-color: #ffc53d;
}

.debug-button {
    background-color: #722ed1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
    display: inline-block;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s;
}

.debug-button:hover {
    background-color: #9254de;
}

.reset-button {
    background-color: white;
    color: #333;
    border: 1px solid #d9d9d9;
}

.reset-button:hover {
    background-color: #f5f5f5;
}

/* 复选框组样式 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.checkbox-group.horizontal-group {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 20px;
}

.checkbox-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

/* 表单行样式 */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-row label {
    min-width: 120px;
    margin-bottom: 0;
}

/* 嵌套表单组样式 */
.form-group .form-group {
    margin-left: 15px;
    margin-top: 10px;
    padding: 10px;
    border-left: 2px solid #e8e8e8;
}

.form-group h3 {
    margin-bottom: 15px;
    color: #1890ff;
    font-size: 1.2rem;
}

.form-group h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1rem;
}

/* 禁用状态样式 */
select:disabled,
input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 只读下拉菜单和复选框样式 */
.readonly-select {
    background-color: #f5f5f5;
    border-color: #d9d9d9;
    color: #666;
    pointer-events: auto !important;
    appearance: auto;
    padding-right: 20px; /* 为下拉箭头预留空间 */
    position: relative;
}

.readonly-select:hover {
    border-color: #d9d9d9;
    cursor: pointer;
}

.readonly-select:focus {
    border-color: #d9d9d9;
    outline: none;
    box-shadow: none;
}

/* 高亮显示首选选项，其他选项变暗 */
.readonly-select option:first-child {
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    position: relative;
}

.readonly-select option:first-child::after {
    content: "";
}

.readonly-select option:not(:first-child) {
    color: #999;
    font-style: italic;
}

.readonly-select option:not(:first-child)::after {
    content: " (不可选)";
    font-size: 0.8em;
    color: #999;
}

/* 禁用选项的特殊样式 */
.readonly-select option[disabled] {
    color: #b3b3b3;
    background-color: #f9f9f9;
    font-style: italic;
}

.readonly-select option[disabled]::after {
    content: " (不可用)";
    font-size: 0.8em;
    color: #999;
}

.readonly-checkbox {
    opacity: 0.7;
    pointer-events: auto !important;
    cursor: pointer;
}

/* 固定值样式 */
.fixed-value {
    padding: 0.5rem;
    background-color: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #666;
}

/* 单选项下拉框样式 */
.single-option {
    background-color: #fafafa;
    border: 1px solid #d9d9d9;
    cursor: default;
}

.single-option option[selected] {
    font-weight: bold;
    background-color: #f0f7ff !important;
    color: #1890ff !important;
}

.single-option option:first-child {
    font-weight: bold;
    background-color: #f5f5f5;
    color: #333;
}

.single-option option[disabled] {
    color: #b3b3b3 !important;
    background-color: #f9f9f9 !important;
    font-style: italic;
}

/* 确保下拉菜单默认选中第一个选项 */
select.single-option {
    color: #333;
    font-weight: normal;
}

/* 确保默认选择状态的强制显示 */
option[selected] {
    display: inline;
    color: #333 !important;
}

option[disabled] {
    display: inline;
    color: #b3b3b3 !important;
} 