/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-color: #007AFF;
    --primary-light: #4DA3FF;
    --primary-dark: #0056B3;
    
    /* 背景色 */
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --input-bg: #F8F9FA;
    
    /* 文字色 */
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-placeholder: #999999;
    --text-white: #FFFFFF;
    
    /* 边框色 */
    --border-color: #E5E7EB;
    --border-focus: #007AFF;
    
    /* 功能色 */
    --success-color: #34C759;
    --error-color: #FF3B30;
    --warning-color: #FF9500;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

html, body {
    height: 100%;
    overflow: hidden;
}

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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ==================== 手机外框 ==================== */
.phone-frame {
    width: 375px;
    height: 812px;
    background: var(--bg-color);
    border-radius: 50px;
    box-shadow: var(--shadow-lg), 
                0 0 0 12px #1a1a1a,
                0 0 0 14px #333;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ==================== 状态栏 ==================== */
.status-bar {
    height: 44px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-color);
    position: relative;
    z-index: 100;
}

.status-time {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-icons .material-icons {
    font-size: 18px;
    color: var(--text-primary);
}

/* ==================== 手机内容区域 ==================== */
.phone-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ==================== 顶部导航 ==================== */
.phone-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-color);
}

.back-icon {
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    margin-left: -8px;
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    width: 60px;
}

/* ==================== 登录区域 ==================== */
.login-section {
    flex: 1;
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==================== 品牌区域 ==================== */
.brand-section {
    text-align: center;
    margin-bottom: 32px;
}

.brand-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-slogan {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==================== 错误提示 ==================== */
.server-error {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--error-color);
    font-size: 14px;
}

.server-error .material-icons {
    font-size: 20px;
}

/* ==================== 表单区域 ==================== */
form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.input-container {
    position: relative;
    background: var(--input-bg);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.input-container:focus-within {
    background: var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.input-field {
    width: 100%;
    height: 56px;
    padding: 16px 48px 16px 48px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-primary);
    background: transparent;
    transition: all 0.3s ease;
    outline: none;
}

.input-field:focus {
    border-color: var(--primary-color);
}

.input-field.error {
    border-color: var(--error-color);
}

.input-field.input-field {
    padding-top: 26px;
}

.input-label {
    position: absolute;
    left: 48px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-placeholder);
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-field:focus ~ .input-label,
.input-field:not(:placeholder-shown) ~ .input-label {
    top: 14px;
    font-size: 12px;
    color: var(--primary-color);
}

.input-field.error ~ .input-label {
    color: var(--error-color);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--text-placeholder);
}

.input-container:focus-within .input-icon {
    color: var(--primary-color);
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-placeholder);
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

.password-toggle .material-icons {
    font-size: 22px;
}

/* ==================== 错误消息 ==================== */
.error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 8px;
    padding-left: 4px;
}

.error-message .material-icons {
    font-size: 16px;
}

/* ==================== 复选框 ==================== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.checkbox-container {
    position: relative;
    cursor: pointer;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkbox-input:checked + .checkbox-box {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-input:checked + .checkbox-box::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
    user-select: none;
}

/* ==================== 提交按钮 ==================== */
.submit-button {
    width: 100%;
    height: 54px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.5);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.submit-button .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-effect 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* ==================== 附加选项 ==================== */
.additional-options {
    text-align: center;
    margin-top: 20px;
}

.link-register {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.link-register:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==================== Home指示条 ==================== */
.home-indicator {
    width: 134px;
    height: 5px;
    background: #1a1a1a;
    border-radius: 3px;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

/* ==================== Toast提示 ==================== */
.toast-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(30, 30, 30, 0.95);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    box-shadow: var(--shadow-md);
    animation: toast-in 0.3s ease;
    pointer-events: auto;
}

.toast .material-icons {
    font-size: 22px;
}

.toast .material-icons.error {
    color: var(--error-color);
}

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

/* ==================== 响应式适配 ==================== */

/* 平板及以上设备 */
@media (min-width: 768px) {
    body {
        padding: 40px;
    }
    
    .phone-frame {
        height: 85vh;
        max-height: 900px;
    }
}

/* 大屏幕设备 */
@media (min-width: 1024px) {
    body {
        padding: 60px;
    }
    
    .phone-frame {
        height: 90vh;
        max-height: 950px;
    }
    
    .phone-frame:hover {
        transform: scale(1.02);
    }
}

/* 超大屏幕 */
@media (min-width: 1440px) {
    body {
        padding: 80px;
    }
    
    .phone-frame {
        height: 92vh;
        max-height: 1000px;
    }
}

/* 横屏适配 */
@media (max-height: 600px) and (orientation: landscape) {
    .phone-frame {
        width: 500px;
        height: 100vh;
        border-radius: 30px;
    }
    
    .status-bar {
        height: 36px;
    }
    
    .phone-header {
        height: 48px;
    }
    
    .login-section {
        padding: 0 20px 20px;
    }
    
    .login-card {
        padding: 24px 20px;
    }
    
    .brand-section {
        margin-bottom: 20px;
    }
    
    .brand-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }
    
    .brand-name {
        font-size: 22px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .input-field {
        height: 48px;
    }
    
    .submit-button {
        height: 48px;
    }
}

/* ==================== 滚动条样式 ==================== */
.phone-content::-webkit-scrollbar {
    width: 0;
}

.phone-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==================== 安全检测遮罩兼容 ==================== */
.fakeguard-loading {
    display: none !important;
}
