/* =====================================================
   我的基地（首页） — 暗色高级感个人角色空间
   ===================================================== */
#home-page {
    --base-bg: #08080d;
    --base-panel: rgba(255, 255, 255, 0.045);
    --base-panel-strong: rgba(255, 255, 255, 0.07);
    --base-line: rgba(255, 255, 255, 0.09);
    --base-text: #f4f4f8;
    --base-muted: #9a9ab0;
    --base-pink: #ff6b8b;
    --base-violet: #8b7bff;
    --base-cyan: #5eead4;
    background: var(--base-bg);
}

.base-root {
    position: relative;
    min-height: 100%;
    padding-bottom: 28px;
}

/* ---------- Hero ---------- */
.base-hero {
    position: relative;
    padding: calc(var(--status-bar-height, 0px) + 22px) 18px 20px;
    background:
        radial-gradient(120% 90% at 12% 0%, rgba(139, 123, 255, 0.22), transparent 52%),
        radial-gradient(100% 80% at 95% 0%, rgba(255, 107, 139, 0.20), transparent 55%),
        linear-gradient(160deg, #1a1b34 0%, #10101f 48%, #08080d 100%);
    overflow: hidden;
    border-bottom: 1px solid var(--base-line);
}
.base-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(46px);
    opacity: .5;
    pointer-events: none;
}
.base-hero-orb-a {
    width: 220px; height: 220px;
    top: -70px; right: -40px;
    background: #8b7bff;
}
.base-hero-orb-b {
    width: 180px; height: 180px;
    bottom: -80px; left: -50px;
    background: #ff6b8b;
}
.base-hero-mesh {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 40%, transparent 80%);
    mask-image: radial-gradient(120% 90% at 50% 0%, #000 40%, transparent 80%);
    pointer-events: none;
}

.base-hero-head {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    z-index: 1;
}
.base-eyebrow {
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--base-cyan);
    font-weight: 600;
    opacity: .9;
}
.base-title {
    margin: 6px 0 4px;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--base-text);
    letter-spacing: .5px;
    text-shadow: 0 2px 24px rgba(255,255,255,0.08);
}
.base-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--base-muted);
}
.base-avatar {
    width: 56px; height: 56px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(140deg, var(--base-pink), var(--base-violet));
    padding: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.08);
    flex: none;
}
.base-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

/* ---------- Stats ---------- */
.base-stats {
    position: relative;
    z-index: 1;
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.base-stat {
    background: var(--base-panel);
    border: 1px solid var(--base-line);
    border-radius: 16px;
    padding: 12px 8px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.base-stat b {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(120deg, var(--base-pink), var(--base-violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.base-stat span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--base-muted);
}

/* ---------- Body / Section ---------- */
.base-body {
    padding: 20px 16px 8px;
    position: relative;
    z-index: 1;
}
.base-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}
.base-section-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--base-text);
}
.base-section-count {
    font-size: 12px;
    color: var(--base-muted);
}

/* ---------- Cards grid ---------- */
.base-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.base-card {
    position: relative;
    display: block;
    border-radius: 18px;
    overflow: hidden;
    background: var(--base-panel);
    border: 1px solid var(--base-line);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .16s ease, box-shadow .16s ease;
}
.base-card:active {
    transform: scale(0.98);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.base-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #15152a;
}
.base-card-cover img,
.base-card-cover .base-card-img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}
.base-card-cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 800;
    color: rgba(255,255,255,0.65);
    background: linear-gradient(150deg, #2b2b55, #1a1a38 55%, #101028);
    z-index: 0;
}
.base-card-badge {
    position: absolute;
    top: 8px; left: 8px;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.base-card-badge.public { background: rgba(94, 234, 212, 0.75); }
.base-card-badge.private { background: rgba(139, 123, 255, 0.75); }
.base-card-info {
    padding: 10px 11px 12px;
    background: rgba(12,12,20,0.35);
}
.base-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--base-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.base-card-desc {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--base-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}

/* ---------- Empty / Login ---------- */
.base-empty,
.base-login-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 46px 28px 20px;
}
.base-empty-art {
    width: 150px;
    height: 150px;
    margin-bottom: 16px;
    filter: drop-shadow(0 18px 36px rgba(0,0,0,0.45));
}
.base-empty h3,
.base-login-hint h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--base-text);
}
.base-empty p,
.base-login-hint p {
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--base-muted);
    max-width: 260px;
    line-height: 1.5;
}
.base-empty-btn,
.base-login-btn {
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 26px;
    border-radius: 26px;
    color: #fff;
    background: linear-gradient(120deg, var(--base-pink), var(--base-violet));
    box-shadow: 0 8px 24px rgba(255, 107, 139, 0.28);
}
.base-empty-btn i { margin-right: 6px; }
.base-login-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--base-violet);
    background: var(--base-panel-strong);
    border: 1px solid var(--base-line);
    margin-bottom: 16px;
}

/* ---------- 加载骨架 ---------- */
.base-skeleton {
    border-radius: 18px;
    overflow: hidden;
    background: var(--base-panel);
    border: 1px solid var(--base-line);
    animation: base-pulse 1.2s ease-in-out infinite;
}
@keyframes base-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

/* =====================================================
   三段式 Tab（作品 / 私藏 / 预设）
   ===================================================== */
.base-tabbar {
    position: relative;
    display: flex;
    gap: 6px;
    margin: 14px 16px 2px;
    padding: 5px;
    background: var(--base-panel);
    border: 1px solid var(--base-line);
    border-radius: 18px;
    z-index: 2;
}
.base-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--base-muted);
    font-size: 14px;
    font-weight: 600;
    padding: 11px 0;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    transition: color .22s ease;
    overflow: hidden;
}
.base-tab i { font-size: 15px; position: relative; z-index: 1; }
/* 每个Tab自带滑入背景，避免绝对定位百分比错位 */
.base-tab::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 13px;
    background:
        linear-gradient(120deg, rgba(255,107,139,0.30), rgba(139,123,255,0.30));
    border: 1px solid rgba(255,255,255,0.10);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.base-tab.active { color: #fff; }
.base-tab.active::before {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(255,107,139,0.18);
}

/* Tab 面板切换 */
.base-tab-panel { display: none; }
.base-tab-panel.active { display: block; animation: base-fadein .25s ease; }
@keyframes base-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.head-with-action { align-items: center; }
.base-preset-upload {
    border: 1px solid rgba(94,234,212,0.35);
    background: rgba(94,234,212,0.08);
    color: var(--base-cyan);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
}
.base-preset-upload:active { transform: scale(.96); }

/* 私藏卡：作者行 + 取消按钮 */
.base-card-author {
    margin-top: 4px;
    font-size: 12px;
    color: var(--base-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.base-unfollow {
    position: absolute;
    top: 8px; right: 8px;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: #fff;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}
.base-unfollow:active { transform: scale(.9); }

/* 预设卡片（整行） */
.base-preset-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    border-radius: 16px;
    background: var(--base-panel);
    border: 1px solid var(--base-line);
    cursor: pointer;
    margin-bottom: 12px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: transform .14s ease;
}
.base-preset-card:active { transform: scale(.985); }
.base-preset-ico {
    width: 46px; height: 46px;
    flex: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #062524;
    background: linear-gradient(135deg, var(--base-cyan), #7dd3b8);
}
.base-preset-info { flex: 1; min-width: 0; }
.base-preset-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--base-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.base-preset-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--base-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.base-preset-card .base-card-badge { position: static; }
.base-preset-del {
    flex: none;
    width: 30px; height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--base-line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    -webkit-tap-highlight-color: transparent;
}
.base-preset-del:active { color: #ff6b8b; transform: scale(.9); }