/* ============================================================
   SSO 测试应用 - 样式表
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f6ef7;
    --primary-dark: #3b5de7;
    --primary-light: #eef1fe;
    --success: #22c55e;
    --success-light: #f0fdf4;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- 布局 ---- */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container-sm {
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ---- 卡片 ---- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.card-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ---- 头部导航 ---- */
.app-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.app-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 800;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
    overflow: hidden;
}

.header-user .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- 按钮 ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.35);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-group .hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

.form-control:disabled {
    background: var(--bg);
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- 提示框 ---- */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success {
    background: var(--success-light);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: var(--danger-light);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--warning-light);
    color: #b45309;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #c7d2fe;
}

.alert .alert-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: -1px;
}

/* ---- 步骤条 ---- */
.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

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

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.3s;
}

.step.active .step-num {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.15);
}

.step.completed .step-num {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-label {
    color: var(--success);
}

/* ---- 环境检查 ---- */
.check-list {
    list-style: none;
}

.check-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.check-item-name {
    font-size: 14px;
    color: var(--text);
}

.check-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.check-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.check-status.pass {
    color: var(--success);
}

.check-status.fail {
    color: var(--danger);
}

.check-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* ---- 用户信息展示 ---- */
.user-profile {
    text-align: center;
    padding: 20px 0;
}

.user-profile .avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(79, 110, 247, 0.3);
}

.user-profile .avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile h2 {
    font-size: 22px;
    margin-bottom: 4px;
}

.user-profile .user-sub {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ---- 信息表格 ---- */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.info-table th {
    width: 160px;
    color: var(--text-secondary);
    font-weight: 600;
    background: var(--bg);
    white-space: nowrap;
}

.info-table td {
    color: var(--text);
    word-break: break-all;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
    border-bottom: none;
}

/* ---- 标签 ---- */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag.success {
    background: var(--success-light);
    color: #15803d;
}

.tag.warning {
    background: var(--warning-light);
    color: #b45309;
}

/* ---- 成功动画 ---- */
.success-animation {
    text-align: center;
    padding: 20px 0 30px;
}

.success-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    animation: scaleIn 0.5s ease;
}

.success-circle svg {
    width: 40px;
    height: 40px;
    color: var(--success);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---- 底部 ---- */
.app-footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ---- 代码块 ---- */
.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    overflow-x: auto;
    margin: 12px 0;
}

.code-block .comment {
    color: #64748b;
}

.code-block .keyword {
    color: #c084fc;
}

.code-block .string {
    color: #86efac;
}

/* ---- 工具类 ---- */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
    .card {
        padding: 20px;
    }

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

    .container {
        padding: 20px 16px;
    }

    .steps::before {
        left: 15%;
        right: 15%;
    }

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

    .info-table th {
        width: 120px;
        font-size: 13px;
    }
}
