/**
 * 安装向导样式
 */

/* CSS 变量 */
:root {
    --primary: #07C160;
    --primary-dark: #059F4D;
    --primary-light: #E7F8EE;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border: #e8e8e8;
    --bg: #f5f7fa;
    --white: #fff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

/* 重置 */
* {
    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;
    color: var(--text);
    line-height: 1.6;
}

/* 安装容器 */
.conn-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    background: #F7F7F7;
    border: 1px solid #E0E0E0;
}
.conn-status .conn-icon {
    font-size: 18px;
    font-weight: bold;
}
.conn-status .conn-icon.success { color: #07C160; }
.conn-status .conn-icon.error { color: #FA5151; }
.conn-status .conn-message { color: #666; }
.conn-status .conn-message.success { color: #059142; }
.conn-status .conn-message.error { color: #D00; }
.conn-status.success { background: #E7F8EE; border-color: #07C160; }
.conn-status.error { background: #FFF0F0; border-color: #FA5151; }
.install-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 安装卡片 */
.install-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 650px;
    padding: 40px;
    position: relative;
}

/* 头部 */
.install-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(7, 193, 96, 0.3);
}

.logo svg {
    width: 36px;
    height: 36px;
    color: white;
}

.install-header h1 {
    font-size: 26px;
    color: var(--text);
    margin-bottom: 8px;
}

.install-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 步骤指示器 */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-num {
    width: 36px;
    height: 36px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s;
}

.step.active .step-num,
.step.done .step-num {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-text {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.step.active .step-text {
    color: var(--primary);
    font-weight: 500;
}

.step-line {
    width: 30px;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    margin-bottom: 20px;
}

/* 步骤内容 */
.install-content {
    min-height: 320px;
}

.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-panel h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* 检查列表 */
.check-list {
    margin-bottom: 24px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: all 0.3s;
}

.check-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.check-icon.success {
    color: var(--success);
}

.check-icon.error {
    color: var(--danger);
}

.check-icon.loading {
    color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.check-text {
    flex: 1;
    font-size: 14px;
}

.check-version {
    font-size: 12px;
    color: var(--text-light);
    background: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 表单 */
.form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group label input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input:disabled {
    background: var(--bg);
    cursor: not-allowed;
}

.form-tip {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

.required {
    color: var(--danger);
}

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #3dbd0d;
}

.btn-default {
    background: var(--bg);
    color: var(--text);
}

.btn-default:hover {
    background: #e8e8e8;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* 边框按钮（测试连接用） */
.btn-outline {
    background: #fff;
    color: #07C160;
    border: 1px solid #07C160;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover {
    background: #E7F8EE;
}
.btn-outline:active {
    background: #d0eed9;
}

.btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.btn-large {
    padding: 16px 48px;
    font-size: 16px;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 可选标签 */
.optional-tag {
    font-size: 12px;
    font-weight: normal;
    color: var(--text-light);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 跳过提示 */
.skip-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #e6f7ff;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--info, #1890ff);
}

.skip-tip svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 成功图标 */
.success-icon {
    width: 90px;
    height: 90px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success-icon svg {
    width: 45px;
    height: 45px;
    color: var(--primary);
}

/* 安装摘要 */
.install-summary {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.summary-value {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

/* 安装信息 */
.install-info {
    background: #fff7e6;
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
}

.install-info h4 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 12px;
}

.install-info ul {
    list-style: none;
    font-size: 13px;
    color: var(--text-secondary);
}

.install-info li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.install-info li::before {
    content: "•";
    position: absolute;
    left: 6px;
    color: var(--warning);
}

.install-info code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* 加载遮罩 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    border-radius: var(--radius);
    z-index: 100;
}

.loading-overlay.show {
    display: flex;
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

.spinner circle {
    stroke: currentColor;
    stroke-dasharray: 60;
}

.loading-text {
    font-size: 16px;
    color: var(--text);
}

.loading-detail {
    font-size: 13px;
    color: var(--text-light);
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
    color: var(--text);
}

.toast-icon {
    font-size: 18px;
}

/* 底部 */
.install-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* 响应式 */
@media (max-width: 768px) {
    .install-card {
        padding: 30px 20px;
        margin: 10px;
    }

    .steps {
        flex-wrap: wrap;
        gap: 10px;
    }

    .step-line {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .btn-row {
        flex-wrap: wrap;
    }

    .btn-row .btn {
        flex: 1;
        min-width: 100px;
    }
}

/* ==================== 登录页面样式 ==================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    position: relative;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-form {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-light);
}

.input-wrapper input {
    padding-left: 44px !important;
    padding-right: 44px !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-light);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.remember-me input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    height: 48px;
    font-size: 16px;
}

.btn-login .btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* 背景 */
.login-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

/* 验证码样式 */
.captcha-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-wrapper .input-wrapper {
    flex: 1;
}

.captcha-canvas {
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.captcha-canvas:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group .captcha-wrapper input {
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 16px;
    font-weight: 600;
}
