/* ===== 星石全站统一暗色主题 ===== */
:root {
    --bg: #0a0a0f;
    --bg2: #12121a;
    --card: #1a1a26;
    --card-hover: #222233;
    --glass: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --text: #f0f0f5;
    --text2: #8888a0;
    --muted: #555566;
    --accent: #a855f7;
    --accent2: #c084fc;
    --glow: rgba(168,85,247,0.3);
    --grad: linear-gradient(135deg, #a855f7, #ec4899);
    --success: #34d399;
    --danger: #f87171;
    --warn: #fbbf24;
    --r: 14px;
    --rs: 8px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }

/* ===== 登录/注册页 ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-box {
    background: var(--card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    width: 400px;
    max-width: 90%;
}

.login-box h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--text);
}

.login-box h2 {
    text-align: center;
    color: var(--text2);
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 30px;
}

/* 表单 */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text2);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--rs);
    font-size: 14px;
    outline: none;
    background: var(--bg2);
    color: var(--text);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
}

.form-group input::placeholder { color: var(--muted); }

/* 提示框 */
.alert { padding: 12px 16px; border-radius: var(--rs); margin-bottom: 20px; font-size: 14px; }
.alert-success { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); color: var(--success); }
.alert-error { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--danger); }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: var(--rs);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover { border-color: var(--accent); color: var(--accent2); }

.btn-primary {
    background: var(--grad);
    border: none;
    color: #fff;
    font-weight: 500;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 16px var(--glow);
    color: #fff;
}

.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { display: block; width: 100%; }

/* ===== 顶部导航 ===== */
.user-header {
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    color: #fff;
    padding: 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.user-header h1 { font-size: 18px; }

.user-header h1 a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.user-header nav {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text2);
}

.user-header nav .btn {
    color: var(--text2);
    border-color: rgba(255,255,255,0.15);
    background: transparent;
    font-size: 12px;
}

.user-header nav .btn:hover {
    border-color: var(--accent);
    color: var(--accent2);
}

/* ===== 区域标题 ===== */
.section-header {
    margin: 28px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    position: relative;
    padding-left: 14px;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: 2px;
    background: var(--grad);
}

/* ===== 圈子横向列表 ===== */
.circle-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 0 16px;
    scrollbar-width: none;
}
.circle-list::-webkit-scrollbar { display: none; }

.circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s;
}

.circle-item:hover { transform: translateY(-3px); }

.circle-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(168,85,247,0.3);
    margin-bottom: 6px;
}

.circle-name {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
    color: var(--text2);
}

.circle-fee { font-size: 11px; color: var(--warn); margin-top: 2px; }
.circle-free { font-size: 11px; color: var(--success); margin-top: 2px; }

/* ===== 帖子网格 ===== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.post-card {
    background: var(--card);
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.25,0.8,0.25,1);
    text-decoration: none;
    color: var(--text);
    display: block;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(168,85,247,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 24px var(--glow);
}

.post-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--bg2);
    display: block;
    text-decoration: none;
}

.post-cover img:not(.cover-logo) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.post-card:hover .post-cover img:not(.cover-logo) { transform: scale(1.08); }

/* 封面logo水印 */
.cover-logo {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.7));
    transition: opacity 0.3s;
}

.post-card:hover .cover-logo {
    opacity: 0.9;
}

.post-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.post-price-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(251,191,36,0.9);
    color: #1a1a2e;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.post-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-media-count {
    position: absolute;
    top: 8px; left: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.post-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    gap: 6px;
    z-index: 3;
}

.post-lock-overlay span { font-size: 13px; font-weight: 500; }
.blurred-preview { filter: blur(12px); }

.post-info { padding: 10px 14px; }

.post-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.post-artist-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.post-artist-name { font-size: 12px; font-weight: 500; color: var(--text); text-decoration: none; }
.post-artist-name:hover { color: var(--accent2); }
.post-artist-link { display: flex; flex-shrink: 0; }
.post-circle-name { font-size: 11px; color: var(--muted); margin-left: auto; }
.post-date { font-size: 11px; color: var(--muted); margin-left: auto; }
.post-text { font-size: 12px; color: var(--text2); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 圈子详情头部 ===== */
.circle-header {
    margin: 20px 0;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg2);
    background-size: cover;
    background-position: center;
}

.circle-header-overlay {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
}

.circle-header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.circle-header-info { color: #fff; }
.circle-header-info h2 { font-size: 22px; margin-bottom: 4px; }
.circle-intro { font-size: 14px; opacity: 0.8; margin-bottom: 4px; }
.circle-artists { font-size: 13px; opacity: 0.65; margin-bottom: 8px; }
.circle-stats { display: flex; gap: 12px; font-size: 13px; }
.circle-stats span { background: rgba(255,255,255,0.1); padding: 3px 10px; border-radius: 12px; }
.circle-join-fee { background: rgba(251,191,36,0.2) !important; color: #fde68a; }
.circle-join-free { background: rgba(52,211,153,0.15) !important; color: #6ee7b7; }

/* ===== 通用元素 ===== */
.page-header { display: flex; justify-content: space-between; align-items: center; margin: 24px 0; }
.page-header h2 { font-size: 22px; }
.filter-bar { display: flex; gap: 8px; }

.pagination { margin: 24px 0; display: flex; gap: 8px; justify-content: center; }

/* ===== 查看页面 ===== */
.view-header { margin: 24px 0 16px; display: flex; justify-content: space-between; align-items: center; }
.view-header h2 { font-size: 20px; }

/* 视频播放器 */
.video-viewer { position: relative; background: #000; border-radius: var(--r); overflow: hidden; }
.video-viewer video { width: 100%; max-height: 75vh; display: block; }
.video-controls { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg2); color: #fff; font-size: 13px; }
.vc-btn { background: var(--accent); color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.vc-btn:hover { background: var(--accent2); }

.vc-progress, .vc-volume {
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.vc-progress { flex: 1; }
.vc-volume { width: 80px; }
.vc-progress::-webkit-slider-thumb, .vc-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

/* 图片查看 */
.image-viewer {
    text-align: center;
    background: var(--bg2);
    border-radius: var(--r);
    padding: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-viewer canvas { max-width: 100%; border-radius: 4px; }

/* 媒体网格 */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.media-card {
    background: var(--card);
    border-radius: var(--r);
    padding: 24px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}
.media-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.media-icon { color: var(--accent); margin-bottom: 12px; }
.media-card h3 { font-size: 16px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-date { font-size: 12px; color: var(--muted); display: block; margin-bottom: 12px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.badge-image { background: rgba(168,85,247,0.15); color: var(--accent2); }
.badge-video { background: rgba(251,191,36,0.15); color: var(--warn); }

/* ===== 艺人主页 ===== */
.artist-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 24px 0;
    background: var(--card);
    border-radius: var(--r);
    padding: 24px;
    border: 1px solid var(--border);
}

.artist-avatar-lg {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(168,85,247,0.3);
    flex-shrink: 0;
}

.artist-info h2 { font-size: 22px; margin-bottom: 8px; }
.artist-stats { display: flex; gap: 12px; font-size: 13px; color: var(--text2); }
.artist-stats span { background: var(--bg2); padding: 4px 12px; border-radius: 12px; border: 1px solid var(--border); }

/* ===== 图片轮播查看器 ===== */
.img-carousel { position: relative; background: var(--bg); border-radius: var(--r); overflow: hidden; }
.img-carousel-viewport { display: flex; transition: transform 0.4s cubic-bezier(0.25,0.8,0.25,1); }
.img-carousel-slide { min-width: 100%; display: flex; align-items: center; justify-content: center; min-height: 300px; padding: 16px; }
.img-canvas { max-width: 100%; max-height: 70vh; display: block; border-radius: 4px; }

.img-carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border: none;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(4px);
    color: #fff; font-size: 26px; border-radius: 50%;
    cursor: pointer; transition: background 0.3s;
    display: flex; align-items: center; justify-content: center; z-index: 10;
}
.img-carousel-btn:hover { background: rgba(255,255,255,0.25); }
.img-carousel-prev { left: 12px; }
.img-carousel-next { right: 12px; }

.img-carousel-counter {
    position: absolute; top: 12px; right: 12px;
    background: rgba(0,0,0,0.6); color: #fff;
    padding: 4px 12px; border-radius: 14px; font-size: 13px; z-index: 10;
}

.img-carousel-thumbs { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 10; }
.img-thumb { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; transition: all 0.3s; }
.img-thumb.active { background: #fff; width: 22px; border-radius: 4px; }

/* ===== 帖子详情页 ===== */
.post-detail {
    background: var(--card);
    border-radius: var(--r);
    border: 1px solid var(--border);
    margin: 20px 0;
    overflow: hidden;
}

.post-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.post-detail-author { display: flex; align-items: center; gap: 12px; }
.author-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(168,85,247,0.3); }
.author-info { display: flex; flex-direction: column; }
.author-name { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; }
.author-name:hover { color: var(--accent2); }
.author-circle { font-size: 12px; color: var(--muted); }
.author-circle a { color: var(--accent2); text-decoration: none; }
.post-detail-time { font-size: 12px; color: var(--muted); }
.post-detail-text { padding: 20px; font-size: 15px; line-height: 1.8; color: var(--text); }

.post-detail-media { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.post-media-item img { width: 100%; border-radius: var(--rs); display: block; }
.post-media-video video { width: 100%; border-radius: var(--rs); background: #000; max-height: 70vh; }
.post-media-audio { padding: 10px 0; }
.post-media-audio audio { width: 100%; }

.post-detail-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}

.post-locked-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    margin: 0 20px 20px;
    background: rgba(168,85,247,0.06);
    border-radius: var(--r);
    border: 2px dashed rgba(168,85,247,0.3);
    color: var(--accent2);
    text-align: center;
}
.post-locked-notice svg { margin-bottom: 12px; color: var(--accent); }
.post-locked-notice p { font-size: 15px; font-weight: 500; }

/* ===== 个人中心 ===== */
.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(236,72,153,0.1));
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: var(--r);
    padding: 24px;
    margin: 20px 0;
}

.profile-avatar img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(168,85,247,0.3); }

.profile-avatar-placeholder {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--grad);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 600; color: #fff;
}

.profile-info { flex: 1; }
.profile-info h2 { font-size: 18px; margin-bottom: 4px; }
.profile-phone { font-size: 13px; color: var(--text2); margin-bottom: 4px; }

.vip-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #5c3d00;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.profile-balance {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 10px 16px;
    border: 1px solid var(--border);
}

.balance-label { font-size: 11px; color: var(--muted); }
.balance-amount { font-size: 20px; font-weight: 700; color: var(--warn); }

.profile-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }

.profile-stat-item {
    background: var(--card);
    border-radius: var(--r);
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.3s;
}
.profile-stat-item:hover { transform: translateY(-2px); border-color: rgba(168,85,247,0.3); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.profile-stat-item .stat-num { display: block; font-size: 24px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.profile-stat-item .stat-label { display: block; font-size: 12px; color: var(--muted); }

.profile-menu {
    background: var(--card);
    border-radius: var(--r);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:hover { background: var(--card-hover); }
.profile-menu-item span { flex: 1; font-size: 15px; }
.profile-menu-item svg { color: var(--accent); flex-shrink: 0; }
.profile-menu-item .menu-arrow { color: var(--muted); }

/* ===== 收藏/订单列表 ===== */
.list-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.list-empty svg { margin-bottom: 12px; color: var(--muted); }
.list-empty p { font-size: 14px; }

.order-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.order-item {
    background: var(--card);
    border-radius: var(--r);
    padding: 16px 20px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
}
.order-item:hover { border-color: rgba(168,85,247,0.2); }

.order-info { display: flex; flex-direction: column; gap: 4px; }
.order-title { font-size: 14px; font-weight: 500; }
.order-time { font-size: 12px; color: var(--muted); }
.order-amount { font-size: 18px; font-weight: 700; color: var(--warn); }

.order-status { font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.order-status-success { background: rgba(52,211,153,0.1); color: var(--success); }
.order-status-pending { background: rgba(251,191,36,0.1); color: var(--warn); }
.order-status-failed { background: rgba(248,113,113,0.1); color: var(--danger); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .user-header .container { height: auto; padding: 10px 16px; gap: 6px; }
    .user-header nav { gap: 8px; font-size: 12px; }

    .post-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }

    .circle-header-overlay { flex-direction: column; text-align: center; padding: 20px; }
    .circle-header-info h2 { font-size: 18px; }
    .circle-stats { justify-content: center; flex-wrap: wrap; }

    .artist-header { flex-direction: column; text-align: center; }
    .artist-stats { justify-content: center; flex-wrap: wrap; }

    .profile-card { flex-wrap: wrap; }
    .profile-balance { width: 100%; flex-direction: row; justify-content: space-between; margin-top: 8px; }
    .profile-stats-grid { gap: 8px; }
    .profile-stat-item .stat-num { font-size: 20px; }

    .order-item { flex-direction: column; align-items: flex-start; gap: 8px; }

    .view-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .media-card { padding: 16px; }
}

@media (max-width: 480px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .section-header h2 { font-size: 17px; }
}
