/**
 * 顶级全能发卡网系统 - 安装页面样式
 * 版本: 1.0.0
 * 说明: PC端采用轻奢磨砂玻璃风，移动端基础适配
 */

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ==================== 安装容器 ==================== */
.install-wrapper {
    width: 100%;
    max-width: 900px;
}

/* ==================== 安装头部 ==================== */
.install-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 28px;
    margin-right: 10px;
    color: #667eea;
}

.logo-text {
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

/* 进度条样式 */
.install-progress {
    position: relative;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 12px;
    color: #999;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: #667eea;
    color: #fff;
}

.step-item.active .step-label {
    color: #667eea;
    font-weight: 600;
}

.step-item.completed .step-number {
    background: #4caf50;
    color: #fff;
}

.step-item.completed .step-label {
    color: #4caf50;
}

.step-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    margin: 0 5px;
    margin-bottom: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-percent {
    text-align: center;
    font-size: 14px;
    color: #667eea;
    margin-top: 8px;
    font-weight: 600;
}

/* ==================== 安装内容区域 ==================== */
.install-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.step-container {
    animation: fadeIn 0.3s ease;
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.step-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.step-desc {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 25px;
}

/* ==================== 步骤1：协议声明 ==================== */
.agreement-box {
    position: relative;
    margin-bottom: 20px;
}

.agreement-content {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    max-height: 350px;
    overflow-y: auto;
    line-height: 1.6;
}

.agreement-content h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.agreement-content h4 {
    font-size: 14px;
    color: #667eea;
    margin-top: 15px;
    margin-bottom: 8px;
}

.agreement-content p {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.btn-full-view {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #667eea;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-full-view:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.agreement-checkbox {
    margin: 20px 0;
}

.agreement-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.agreement-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.agreement-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: #667eea;
    border-color: #667eea;
}

.agreement-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
}

.checkbox-text {
    font-size: 14px;
}

/* ==================== 步骤2：环境检测 ==================== */
.env-check-container {
    margin-bottom: 20px;
}

.check-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.section-icon {
    margin-right: 8px;
    font-size: 18px;
}

.check-items {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

.check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.check-item:last-child {
    border-bottom: none;
}

.check-item-name {
    font-size: 13px;
    color: #333;
    flex: 1;
}

.check-item-value {
    font-size: 13px;
    color: #666;
    margin: 0 15px;
}

.check-item-status {
    display: flex;
    align-items: center;
}

.status-pass {
    color: #4caf50;
    font-size: 18px;
}

.status-fail {
    color: #f44336;
    font-size: 18px;
}

.solution-text {
    font-size: 12px;
    color: #ff9800;
    margin-top: 5px;
    padding-left: 20px;
}

.copy-btn {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #5568d3;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

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

.loading-text {
    font-size: 13px;
    color: #999;
}

/* ==================== 表单样式 ==================== */
.form-container {
    max-width: 500px;
    margin: 0 auto;
}

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

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"] {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
}

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

.form-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.form-error {
    display: block;
    font-size: 12px;
    color: #f44336;
    margin-top: 5px;
    min-height: 18px;
}

/* 密码强度指示器 */
.password-strength {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-bar.weak {
    background: #f44336;
}

.strength-bar.medium {
    background: #ff9800;
}

.strength-bar.strong {
    background: #4caf50;
}

.password-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.form-actions {
    margin-top: 15px;
}

/* 连接状态 */
.connection-status {
    margin: 15px 0;
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

.connection-status.success {
    background: #e8f5e9;
    border: 1px solid #4caf50;
}

.connection-status.error {
    background: #ffebee;
    border: 1px solid #f44336;
}

.status-icon {
    font-size: 18px;
    margin-right: 10px;
}

.connection-status.success .status-icon {
    color: #4caf50;
}

.connection-status.error .status-icon {
    color: #f44336;
}

.status-text {
    font-size: 13px;
}

/* ==================== 按钮样式 ==================== */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.btn-prev,
.btn-next,
.btn-test,
.btn-recheck,
.btn-enter,
.btn-disabled {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prev {
    background: #f0f0f0;
    color: #666;
}

.btn-prev:hover {
    background: #e0e0e0;
}

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

.btn-next:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-next:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-test {
    background: #667eea;
    color: #fff;
    width: 120px;
}

.btn-test:hover {
    background: #5568d3;
}

.btn-recheck {
    background: #ff9800;
    color: #fff;
}

.btn-recheck:hover {
    background: #f57c00;
}

.btn-enter {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #fff;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.btn-enter:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==================== 步骤5：安装完成 ==================== */
.install-success {
    text-align: center;
    margin-bottom: 30px;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: #fff;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.success-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.success-message {
    font-size: 14px;
    color: #666;
}

.install-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.info-list {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
}

.install-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.notice-title {
    font-size: 16px;
    color: #856404;
    margin-bottom: 15px;
}

.notice-list {
    list-style: none;
    font-size: 13px;
    color: #856404;
    line-height: 1.8;
}

.notice-list li {
    padding-left: 20px;
    position: relative;
}

.notice-list li::before {
    content: '•';
    position: absolute;
    left: 5px;
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.success {
    background: rgba(76, 175, 80, 0.9);
}

.toast.error {
    background: rgba(244, 67, 54, 0.9);
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 30px;
}

/* ==================== 移动端适配（基础版）==================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .install-header {
        padding: 15px 20px;
        border-radius: 6px;
    }

    .logo-text {
        font-size: 18px;
    }

    .logo-icon {
        font-size: 24px;
    }

    .progress-steps {
        flex-wrap: wrap;
    }

    .step-label {
        font-size: 10px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-line {
        height: 1px;
    }

    .progress-bar-container {
        height: 6px;
    }

    .progress-percent {
        font-size: 12px;
    }

    .install-content {
        padding: 20px;
        border-radius: 6px;
    }

    .step-title {
        font-size: 20px;
    }

    .step-desc {
        font-size: 13px;
    }

    .agreement-content {
        max-height: 250px;
        padding: 15px;
    }

    .agreement-content h3 {
        font-size: 14px;
    }

    .agreement-content h4 {
        font-size: 13px;
    }

    .agreement-content p {
        font-size: 12px;
    }

    .btn-full-view {
        font-size: 11px;
        padding: 4px 8px;
    }

    .checkbox-text {
        font-size: 13px;
    }

    .form-group input {
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-hint {
        font-size: 11px;
    }

    .step-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-prev,
    .btn-next,
    .btn-test,
    .btn-recheck,
    .btn-enter {
        width: 100%;
        padding: 10px 20px;
        font-size: 13px;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .success-title {
        font-size: 18px;
    }

    .info-list,
    .notice-list {
        font-size: 12px;
    }

    .toast {
        font-size: 13px;
        padding: 10px 20px;
        bottom: 20px;
    }
}

/* ==================== 横竖屏自适应 ==================== */
@media (orientation: landscape) and (max-height: 500px) {
    .install-header {
        padding: 10px 15px;
        margin-bottom: 10px;
    }

    .logo {
        margin-bottom: 10px;
    }

    .progress-steps {
        margin-bottom: 10px;
    }

    .install-content {
        padding: 15px;
    }

    .step-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .step-desc {
        margin-bottom: 15px;
    }
}
