/* =============================================================
   创建角色页（v7.2 final）— 单列紧凑流 / 紫色梦幻
   排版思路：所有内容居中（max-width 640px），section 上下紧凑
   ============================================================= */

/* 覆盖 MainLayout 的 is-full 行为（让长内容可滚动） */
html body .page.is-full:has(.cr-page) {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
}
html body .page.is-full:has(.cr-page) .main-content {
    display: block !important;
}
html body .page.is-full:has(.cr-page) .main-content > .container {
    display: block !important;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* 背景渐变挂 html（fixed，跟随滚动） */
html:has(.cr-page) {
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(102, 126, 234, 0.20) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(240, 147, 251, 0.15) 0%, transparent 70%),
        linear-gradient(180deg, #f5f7fb 0%, #fafbff 100%);
    background-attachment: fixed;
}

/* ===== 单列容器（紧凑） ===== */
.cr-page {
    min-height: 100vh;
    padding: 0.85rem 1rem 2rem;
    color: #1e293b;
    font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.cr-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;     /* 关键：section 之间 14px 间距，整体更紧凑 */
}

/* ===== 头部 ===== */
.cr-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem 0.25rem 0.25rem;
}
.cr-back {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #475569;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: all 0.2s ease;
}
.cr-back:hover { background: #fff; transform: translateX(-2px); }
.cr-head-text { flex: 1; min-width: 0; }
.cr-title {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0 0 0.1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
    line-height: 1.1;
}
.cr-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ===== 步骤指示器（横排） ===== */
.cr-progress {
    display: flex;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 0.45rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.cr-pdot {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.2rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.25s ease;
    min-width: 0;
}
.cr-pdot-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.25s ease;
}
.cr-pdot-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cr-pdot.active {
    color: #4f46e5;
    background: rgba(102, 126, 234, 0.10);
}
.cr-pdot.active .cr-pdot-num {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}
.cr-pdot.done { color: #059669; }
.cr-pdot.done .cr-pdot-num { background: #10b981; color: #fff; }

/* ===== Section 通用 ===== */
.cr-section {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    padding: 0.95rem 1.05rem 1.05rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: all 0.25s ease;
}
.cr-section.cr-disabled {
    opacity: 0.5;
    filter: grayscale(0.4);
    pointer-events: none;
}

.cr-sec-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
}
.cr-sec-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.30);
    flex-shrink: 0;
}
.cr-sec-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}
.cr-sec-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-left: auto;
}

/* ===== 区服输入 ===== */
.cr-zone-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.cr-zone-input {
    flex: 1;
    padding: 0.7rem 0.9rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    caret-color: #667eea;
    transition: all 0.2s ease;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}
.cr-zone-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}
.cr-verify-btn {
    padding: 0 1.1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.30);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
}
.cr-verify-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(102, 126, 234, 0.40);
}
.cr-verify-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* v7.2.5：验证通过后锁定区服码 + 修改按钮 */
.cr-zone-input-locked {
    flex: 1;
    padding: 0.7rem 0.9rem;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.15em;
    cursor: not-allowed;
}
.cr-change-btn {
    padding: 0 1.1rem;
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cr-change-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #1e293b;
}

/* 区服验证结果 */
.cr-zone-success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.10), rgba(6, 182, 212, 0.05));
    border: 1.5px solid rgba(16, 185, 129, 0.30);
    border-radius: 10px;
    animation: cr-fade-in 0.3s ease;
}
.cr-zone-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
}
.cr-zone-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.cr-zone-name { font-weight: 700; color: #065f46; font-size: 0.92rem; }
.cr-zone-id { color: #047857; font-size: 0.78rem; font-weight: 500; }
.cr-zone-desc { color: #047857; font-size: 0.75rem; opacity: 0.85; }
.cr-zone-meta { color: #047857; font-size: 0.7rem; opacity: 0.75; }
.cr-zone-check {
    width: 24px;
    height: 24px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.cr-zone-error {
    padding: 0.65rem 0.85rem;
    background: rgba(245, 158, 11, 0.10);
    border: 1.5px solid rgba(245, 158, 11, 0.30);
    border-radius: 10px;
    color: #b45309;
    font-size: 0.85rem;
    animation: cr-shake 0.3s ease;
}
@keyframes cr-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes cr-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* 区服快捷选择（紧凑） */
.cr-zone-list-tip {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 0.5rem 0 0.4rem;
}
.cr-zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.4rem;
}
.cr-zone-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 0;
}
.cr-zone-chip:hover {
    border-color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.12);
}
.cr-zone-chip.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}
.cr-zone-chip-icon { font-size: 1.1rem; flex-shrink: 0; }
.cr-zone-chip-id {
    font-weight: 700;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.cr-zone-chip-name {
    font-size: 0.72rem;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ===== 职业网格（紧凑） ===== */
.cr-job-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}
.cr-job-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.65rem 0.3rem 0.55rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    gap: 0.15rem;
}
.cr-job-tile:hover {
    transform: translateY(-1px);
    border-color: #c7d2fe;
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.12);
}
.cr-job-tile.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.40);
    color: #fff;
}
.cr-job-icon { font-size: 1.4rem; line-height: 1; }
.cr-job-name { font-size: 0.78rem; font-weight: 700; }
.cr-job-tag { font-size: 0.62rem; opacity: 0.7; line-height: 1.2; }
.cr-job-tile.selected .cr-job-tag { color: rgba(255, 255, 255, 0.9); }

/* ===== 性别（紧凑） ===== */
.cr-sex-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.cr-sex-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
}
.cr-sex-tile:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08); }
.cr-sex-tile.cr-sex-male.selected {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 172, 254, 0.40);
}
.cr-sex-tile.cr-sex-female.selected {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 87, 108, 0.40);
}
.cr-sex-icon { font-size: 1.4rem; line-height: 1; }

/* ===== 昵称 ===== */
.cr-nick-row {
    position: relative;
}
.cr-nick-input {
    width: 100%;
    padding: 0.7rem 3.5rem 0.7rem 0.9rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.92rem;
    color: #1e293b;
    caret-color: #667eea;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.cr-nick-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}
.cr-nick-count {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: #94a3b8;
    pointer-events: none;
}

/* ===== 提交按钮 + 错误 ===== */
.cr-submit-error {
    padding: 0.65rem 0.85rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1.5px solid rgba(239, 68, 68, 0.30);
    border-radius: 10px;
    color: #b91c1c;
    font-size: 0.85rem;
    animation: cr-shake 0.3s ease;
}
.cr-submit {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 100%;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.30);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}
.cr-submit:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.40);
}
.cr-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}
.cr-foot-note {
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: -0.1rem;
}

.cr-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cr-spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes cr-spin { to { transform: rotate(360deg); } }

/* ===== 移动端 ===== */
@media (max-width: 480px) {
    .cr-page { padding: 0.5rem 0.75rem 1.5rem; }
    .cr-inner { gap: 0.7rem; }
    .cr-title { font-size: 1.25rem; }
    .cr-sub { font-size: 0.72rem; }
    .cr-pdot-label { display: none; }
    .cr-section { padding: 0.85rem 0.9rem 0.95rem; }
    .cr-job-grid { grid-template-columns: repeat(4, 1fr); gap: 0.35rem; }
    .cr-job-tile { padding: 0.55rem 0.2rem 0.5rem; }
    .cr-job-icon { font-size: 1.2rem; }
    .cr-job-name { font-size: 0.72rem; }
    .cr-job-tag { display: none; }
    .cr-zone-grid { grid-template-columns: repeat(2, 1fr); }
    .cr-sex-tile { padding: 0.75rem; font-size: 0.88rem; }
}
