/* 公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #2c3e50;
    min-height: 100vh;
}

/* 加载页面 */
.loading-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

.loading-content p {
    font-size: 16px;
    opacity: 0.8;
}

/* 表单容器 */
.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.form-box {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    padding: 45px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 35px;
}

/* 表单组 */
.form-group {
    margin-bottom: 25px;
}

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

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.form-group input::placeholder {
    color: #adb5bd;
}

/* 验证码组 */
.code-group {
    display: flex;
    gap: 12px;
}

.code-group input {
    flex: 1;
}

.code-group button {
    padding: 14px 20px;
    font-size: 14px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.code-group button:hover:not(:disabled) {
    background-color: #2980b9;
}

.code-group button:disabled {
    background-color: #ddd;
    color: #666;
    cursor: not-allowed;
}

/* 主按钮 */
.btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-primary:disabled {
    background-color: #ddd;
    color: #666;
    cursor: not-allowed;
}

/* 链接区域 */
.link-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 25px;
    font-size: 14px;
}

.link-area .text {
    color: #999;
}

.link-area .link {
    color: #3498db;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.link-area .link:hover {
    text-decoration: underline;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 300px;
    text-align: center;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 16px;
}

.modal-content button {
    padding: 10px 30px;
    font-size: 14px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

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

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

/* 响应式 */
@media (max-width: 480px) {
    .form-box {
        padding: 30px 25px;
        margin: 20px;
    }
    
    .form-title {
        font-size: 20px;
    }
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* 裁剪弹窗 */
.crop-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.crop-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.crop-modal-title {
    font-size: 16px;
    font-weight: 500;
}

.crop-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.crop-modal-close:hover {
    color: #333;
}

.crop-modal-body {
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

.crop-container {
    width: 100%;
    height: 300px;
    background: #f5f5f5;
}

.crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.crop-btn-cancel,
.crop-btn-confirm {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
}

.crop-btn-cancel {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
}

.crop-btn-cancel:hover {
    background: #eee;
}

.crop-btn-confirm {
    background: #3498db;
    border: none;
    color: white;
}

.crop-btn-confirm:hover {
    background: #2980b9;
}