/**
 * 一键安装页样式（与后台风格一致，左侧仅安装主题）
 * 安装页独立布局，不依赖 login.css 的左右分栏
 */

/* ========== 安装页整体布局（login-container 仅安装页使用） ========== */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* 右侧：表单区域 */
.login-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
    background: #ffffff;
}

/* 品牌区：Logo + 标题（安装页右侧顶部） */
.brand-section {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    margin-bottom: 14px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    position: relative;
}

.droplet-left {
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 56px;
    background: #1e3a8a;
    border-radius: 28px 0 0 28px;
}

.droplet-right {
    position: absolute;
    right: 0;
    top: 0;
    width: 28px;
    height: 56px;
    background: #3b82f6;
    border-radius: 0 28px 28px 0;
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
}

/* ========== 左侧：仅安装主题 ========== */
.install-left {
    flex: 1;
    position: relative;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.install-left-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    clip-path: polygon(0 40%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 1;
}

.install-left-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 48px 40px;
    max-width: 360px;
}

.install-left-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.install-left-icon i {
    font-size: 36px;
    color: #fff;
}

.install-left-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.install-left-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 32px;
}

.install-left-steps {
    list-style: none;
    text-align: left;
}

.install-left-steps li {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.install-left-steps li i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .install-left {
        min-height: 28vh;
        padding: 24px 20px;
    }

    .install-left-bg {
        height: 100%;
        clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    }

    .install-left-content {
        padding: 24px 20px;
    }

    .install-left-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }

    .install-left-icon i {
        font-size: 26px;
    }

    .install-left-title {
        font-size: 22px;
    }

    .install-left-desc {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .install-left-steps li {
        font-size: 13px;
    }
}

/* ========== 右侧内容区 ========== */
.install-section .login-form-container {
    max-width: 480px;
    width: 100%;
}

.install-section .brand-section {
    margin-bottom: 20px;
}

.install-section .brand-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1f2937;
}

.install-section .brand-subtitle {
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 0;
}

/* 步骤条 */
.install-steps {
    display: flex;
    margin-bottom: 22px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
    padding: 0 4px;
}

.install-step-item {
    flex: 1;
    text-align: center;
    padding: 12px 6px;
    font-size: 12px;
    color: #9ca3af;
    position: relative;
    transition: color 0.25s ease;
}

.install-step-item::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.install-step-item.active {
    color: #1e40af;
    font-weight: 600;
}

.install-step-item.active::after {
    width: 50%;
    left: 25%;
}

.install-step-item.done {
    color: #059669;
}

/* 步骤面板 */
.install-panel {
    display: none;
    animation: installPanelIn 0.25s ease;
}

.install-panel.active {
    display: block;
}

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

.install-section .form-group {
    margin-bottom: 16px;
}

.install-tip {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 6px;
    margin-bottom: 12px;
}

.install-section .form-group .install-tip {
    margin-bottom: 8px;
}

.install-section .form-group .install-tip:last-child {
    margin-bottom: 0;
}

/* 醒目提示（网站与管理员步骤中的重要说明） */
.install-tip-notice {
    color: #b91c1c !important;
    font-weight: 600;
    font-size: 12px;
}

/* 环境检测列表 */
.install-env-list {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 2px 0;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.install-env-item {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    transition: background 0.2s ease;
}

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

.install-env-item:hover {
    background: rgba(255, 255, 255, 0.6);
}

.install-env-name {
    flex: 0 0 160px;
    color: #374151;
}

.install-env-status {
    margin-left: auto;
    font-size: 12px;
}

.install-env-status.ok {
    color: #059669;
    font-weight: 500;
}

.install-env-status.fail {
    color: #dc2626;
    font-weight: 500;
}

.install-env-status.pending {
    color: #9ca3af;
    font-style: italic;
}

/* 环境检测面板内首条提示 */
#panel-1 .install-tip {
    margin-bottom: 12px;
}

/* 表单行（两列） */
.install-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.install-form-row .form-group {
    margin-bottom: 16px;
}

.install-divider {
    margin: 18px 0 16px;
    border: 0;
    border-top: 1px dashed #e5e7eb;
}

/* 按钮栏 */
.install-action-bar {
    margin-top: 22px;
    padding-top: 4px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.install-btn-secondary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0 14px;
    height: 34px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.install-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.install-btn-secondary:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.install-btn-primary {
    background: #2563eb;
    border: none;
    color: white;
    padding: 0 18px;
    height: 34px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.install-btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.install-btn-primary:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.install-btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

.install-loading-inline {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

/* 安装成功 */
.install-success {
    text-align: center;
    padding: 28px 0 20px;
    display: none;
}

.install-success.show {
    display: block;
    animation: installPanelIn 0.3s ease;
}

.install-success-icon {
    font-size: 52px;
    color: #059669;
    margin-bottom: 18px;
    animation: installSuccessIcon 0.5s ease 0.1s both;
}

@keyframes installSuccessIcon {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.install-success h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.install-success p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 22px;
    line-height: 1.5;
}

.install-success .login-btn {
    display: inline-block;
    width: auto;
    padding: 0 24px;
    height: 36px;
    line-height: 36px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.install-success .login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 安装页 Toast（与后台 message-toast 风格一致，居中顶部的简化版） */
.install-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    padding: 10px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    z-index: 1001;
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.install-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.install-toast.success {
    background: #10b981;
}

.install-toast.error {
    background: #ef4444;
}

.install-error-log {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    max-height: 280px;
    overflow: auto;
}

.install-error-log h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #b91c1c;
}

.install-error-log pre {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    color: #7f1d1d;
}

/* 版权（安装页右侧底部） */
.install-section .copyright {
    margin-top: auto;
    padding-top: 24px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

/* 输入框在安装页的细节（继承 login.css，此处做小补充） */
.install-section .input-wrapper {
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.install-section .input-wrapper:focus-within {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* 响应式 */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .install-left {
        min-height: 28vh;
    }

    .login-section {
        padding: 24px 16px;
    }

    .install-form-row {
        grid-template-columns: 1fr;
    }

    .install-steps {
        padding: 0 2px;
    }

    .install-step-item {
        padding: 10px 4px;
    }
}

@media (max-width: 480px) {
    .install-steps {
        flex-wrap: wrap;
        gap: 0;
    }

    .install-step-item {
        flex: 0 0 50%;
        font-size: 11px;
        padding: 10px 4px;
    }

    .install-section .brand-title {
        font-size: 20px;
    }
}
