/**
 * 主样式文件
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 卡片样式 */
.login-card,
.config-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
    position: relative;
    width: 70%;
    margin: 0 auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头部样式 */
.login-header,
.config-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1,
.config-header h1 {
    font-size: 28px;
    color: #667eea;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.login-header p,
.config-header p {
    color: #666;
    font-size: 14px;
}

/* 语言切换 */
.lang-switch {
    position: static;
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.lang-switch .btn {
    padding: 8px 12px;
    font-size: 12px;
}

/* 表单样式 */
.login-form,
.config-form {
    margin-top: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* 扫码模式样式 */
.scan-mode {
    background-color: #f0f7ff;
    border-color: #667eea;
}

.scan-mode-hint {
    background-color: #e8f4fd;
    color: #0288d1;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #0288d1;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e0e0e0;
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

/* 消息样式 */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #c62828;
    animation: fadeIn 0.2s ease-in;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #2e7d32;
}

/* 页脚样式 */
.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.login-footer p {
    color: #999;
    font-size: 12px;
}

/* 语言切换按钮等宽 */
.lang-switch .btn {
    min-width: 88px;
    text-align: center;
}

/* 配置页面样式 */
.config-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.config-section:last-child {
    border-bottom: none;
}

.config-section h2 {
    font-size: 20px;
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 30px;
    justify-content: flex-end;
}

.form-actions .btn-primary {
    width: auto;
    min-width: 120px;
}

/* 复选框样式 */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

