/* ============================================
   付费进群系统 - 安装向导样式
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 进度条 ========== */
.progress-bar-wrap {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    color: #999;
    font-size: 13px;
}

.progress-step .step-num {
    display: inline-flex;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8e8e8;
    color: #999;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.progress-step .step-label {
    display: block;
    font-size: 12px;
}

.progress-step.active .step-num {
    background: #1677ff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(22,119,255,0.3);
}

.progress-step.active { color: #1677ff; font-weight: 500; }

.progress-step.done .step-num {
    background: #52c41a;
    color: #fff;
}

.progress-step.done { color: #52c41a; }

/* 步骤间连线 */
.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #e8e8e8;
    z-index: -1;
}
.progress-step.done:not(:last-child)::after { background: #52c41a; }

/* ========== 主容器 ========== */
.install-container {
    max-width: 720px;
    margin: 32px auto;
    padding: 0 16px;
}

/* ========== 卡片 ========== */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 40px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.page-desc {
    color: #888;
    font-size: 14px;
    margin-bottom: 28px;
}

/* ========== Toast（居中半透明） ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 14px 28px;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    z-index: 9999;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: toastIn 0.3s ease;
    pointer-events: none;
    max-width: 360px;
    line-height: 1.4;
}

.toast-success { background: rgba(22, 163, 74, 0.75); }
.toast-error   { background: rgba(220, 38, 38, 0.75); }
.toast-warning  { background: rgba(234, 179, 8, 0.75); }
.toast-info     { background: rgba(22, 119, 255, 0.75); }

.toast.hide {
    opacity: 0;
    transform: translate(-50%, -60%);
    transition: all 0.3s ease;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ========== 协议区域 ========== */
.license-box {
    background: #fafbfc;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.license-box h3 {
    font-size: 16px;
    margin-bottom: 14px;
    color: #333;
}

.license-text {
    max-height: 220px;
    overflow-y: auto;
    font-size: 13px;
    color: #666;
    line-height: 2;
    padding-right: 8px;
}

.license-text p { margin-bottom: 4px; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    margin-bottom: 24px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1677ff;
    cursor: pointer;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    text-align: center;
    line-height: 1.4;
    margin-top: 10px;
}

.btn-primary {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
}

.btn-primary:hover {
    background: #0958d9;
    border-color: #0958d9;
    box-shadow: 0 3px 12px rgba(22,119,255,0.35);
}

.btn-default {
    background: #fff;
    color: #555;
    border-color: #d9d9d9;
}

.btn-default:hover {
    color: #1677ff;
    border-color: #1677ff;
}

.btn-large {
    padding: 10px 30px;
    font-size: 16px;
    border-radius: 10px;
}

/* ========== 表单操作区 ========== */
.form-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.form-actions .btn + .btn { margin-left: 0; }
.form-actions a.btn { display: inline-flex; align-items: center; }

/* ========== 环境检测表格 ========== */
.env-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.env-table th,
.env-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.env-table th {
    background: #fafbfc;
    font-weight: 600;
    color: #444;
    font-size: 13px;
}

.env-table tbody tr:hover { background: #fafbfc; }

.badge-opt {
    display: inline-block;
    background: #e6f4ff;
    color: #1677ff;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    vertical-align: middle;
}

.td-status { white-space: nowrap; }

.status-pass {
    color: #16a34a;
    font-weight: 600;
    font-size: 13px;
}
.status-fail {
    color: #dc2626;
    font-weight: 600;
    font-size: 13px;
}
.status-warn {
    color: #d97706;
    font-weight: 600;
    font-size: 13px;
}

.text-muted { color: #aaa; font-size: 12px; }
.text-error { color: #dc2626; font-size: 12px; }

/* ========== 数据库配置表单 ========== */
.db-form .form-group {
    margin-bottom: 18px;
}

.db-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.db-form input[type="text"],
.db-form input[type="password"],
.db-form input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.25s;
    outline: none;
    background: #fff;
}

.db-form input:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}

.db-form input::placeholder { color: #bbb; }

/* ========== 安装Loading遮罩 ========== */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8e8e8;
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 18px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-size: 16px;
    color: #555;
    font-weight: 500;
    margin-bottom: 20px;
}

/* ========== 安装进度条 ========== */
.install-progress-wrap {
    width: 80%;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-progress-track {
    flex: 1;
    height: 12px;
    background: #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
}

.install-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1677ff, #4096ff);
    border-radius: 6px;
    transition: width 0.2s ease;
}

.install-progress-pct {
    font-size: 14px;
    font-weight: 600;
    color: #1677ff;
    min-width: 40px;
    text-align: right;
}

.loading-step-text {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    transition: opacity 0.2s ease;
}

/* ========== 管理员信息框（极简单行） ========== */
.admin-info-box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    background: #f6f8fa;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 10px 0 24px;
}

.cred-item {
    font-size: 14px;
    color: #888;
    white-space: nowrap;
}

.cred-item strong {
    margin-left: 6px;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    font-family: Consolas, Monaco, "Courier New", monospace;
    letter-spacing: 0.5px;
}

.cred-divider {
    width: 1px;
    height: 14px;
    background: #ddd;
}

/* ========== 安装摘要 ========== */
.info-summary {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.info-summary h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #333;
}

.info-summary ul { list-style: none; }
.info-summary li {
    padding: 5px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px dashed #eee;
}
.info-summary li:last-child { border-bottom: none; }
.info-summary strong { color: #222; }

/* ========== 安装成功 ========== */
.install-success { text-align: center; padding: 10px 0; }

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    line-height: 1;
}

.install-success h2 {
    font-size: 22px;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.install-details {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 16px 20px;
    text-align: left;
    margin: 24px 0 24px;
}

.install-details p {
    font-size: 14px;
    color: #166534;
    padding: 3px 0;
}

/* 入口卡片 */
.entry-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.entry-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.25s ease;
}

.entry-card:hover {
    border-color: #1677ff;
    box-shadow: 0 3px 14px rgba(22,119,255,0.15);
    transform: translateY(-2px);
}

.entry-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #e6f4ff;
    color: #1677ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.entry-info { flex: 1; }
.entry-info strong { display: block; font-size: 15px; }
.entry-info small { color: #999; font-size: 12px; }
.arrow { color: #ccc; font-size: 18px; }

.security-warning {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 14px 20px;
    text-align: left;
    margin-bottom: 8px;
}

.security-warning p {
    font-size: 13px;
    color: #854d0e;
}

.security-warning code {
    background: rgba(0,0,0,0.06);
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 13px;
}

.security-warning strong { color: #a16207; }

/* ========== 安装失败 ========== */
.install-error { text-align: center; padding: 10px 0; }

.error-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    line-height: 1;
}

.install-error h2 { font-size: 22px; color: #1a1a1a; margin-bottom: 12px; }

.error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 14px 20px;
    color: #991b1b;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: left;
}

/* ========== 响应式 ========== */
@media (max-width: 600px) {
    .card { padding: 24px 18px; }
    
    .progress-steps { padding: 0 8px; }
    .progress-step .step-num { width: 28px; height: 28px; font-size: 12px; }
    .progress-step .step-label { font-size: 11px; }
    
    .install-container { margin: 16px auto; }
    
    .entry-links { grid-template-columns: 1fr; }
    
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; text-align: center; white-space: nowrap; }
    .form-actions.btn-group-mobile { flex-direction: row; justify-content: center; }
    .form-actions.btn-group-mobile .btn { width: auto; flex: 1; white-space: nowrap; padding: 10px 12px; font-size: 13px; display: flex; justify-content: center; align-items: center; text-align: center; }
    .form-actions.btn-group-mobile .btn-large { width: auto; flex: 1; white-space: nowrap; }
    
    .env-table th,
    .env-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .toast { max-width: 280px; padding: 12px 20px; font-size: 14px; }
    
    .btn-large { width: 100%; }
}
