/* --- 1. 全局变量 (白金轻奢 - Platinum Luxury) --- */
:root {
    --bg-app: #F7F9FC;
    /* 整体背景：冷调灰白 */
    --bg-card: #FFFFFF;
    /* 卡片背景：纯白 */

    --gold-primary: #C6A34F;
    /* 沉稳流沙金 */
    --gold-light: #FBF6E9;
    /* 浅金背景 */
    --gold-dark: #8A7030;
    /* 深金文字 */

    --text-main: #2C2C2C;
    /* 主黑 */
    --text-sub: #969696;
    /* 次灰 */
    --black-accent: #1A1A1A;
    /* 装饰黑 */

    --radius-box: 16px;
    --shadow-float: 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.03);
    --success-color: #28a745;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, "PingFang SC", sans-serif;
    background: #fff;
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    color: var(--text-main);
}

#app-root {
    width: 100%;
    max-width: 390px;
    height: 100%;
    background: var(--bg-app);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
}

/* 滚动容器 */
.page {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 70px;
    /* 预留底部导航空间 */
    position: relative;
    scroll-behavior: smooth;
}

.page::-webkit-scrollbar {
    display: none;
}

.hidden {
    display: none !important;
}

/* 通用组件 */
.btn {
    border: none;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-gold {
    background: var(--black-accent);
    color: var(--gold-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-box);
    padding: 16px;
    margin: 0 16px 12px 16px;
    box-shadow: var(--shadow-card);
}

/* 表单样式 */
.form-label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.form-input {
    width: 100%;
    height: 44px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    background: #fff;
}

.form-input:focus {
    border-color: var(--gold-primary);
}

/* --- 2. 顶部导航 (Unified Premium Style) --- */
.navbar {
    height: 54px;
    padding-top: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1px;
    z-index: 50;
    position: relative;
    color: var(--black-accent);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    /* Subtle separator */
}

/* ... skipped nav-back ... */

/* ... (skip middle content) ... */

/* 底部导航 (Unified Premium Style) */
.tabbar {
    height: 60px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: none;
    /* Clean flat look or consistent shadow */
    display: flex;
    justify-content: space-around;
    padding-top: 6px;
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 100;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    font-size: 10px;
    gap: 4px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.tab-item.active {
    color: #000;
    /* Selected Black */
    font-weight: 800;
    transform: translateY(-2px);
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    transition: all 0.2s;
}

/* 详情页 Overlay */
.detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.detail-overlay.show {
    transform: translateX(0);
}

/* === New Paywall Card Style === */
.paywall {
    position: relative;
    margin-top: -85px;
    /* Keep the overlap positioning */
    z-index: 10;

    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    border: 1px solid #EAEAEA;
    /* Blend the mask shadow with the card shadow */
    box-shadow: 0 -40px 80px 40px rgba(255, 255, 255, 1), 0 4px 20px rgba(0, 0, 0, 0.05);
}

.card-header h3 {
    margin: 0;
    font-size: 17px;
    color: #222;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.card-desc {
    margin-top: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: transform 0.1s;
    box-sizing: border-box;
}

.btn-option:active {
    transform: scale(0.99);
}

.btn-single {
    background-color: #2C2C2C;
    color: #FFF;
}

.btn-member {
    background-color: #FFD700;
    color: #000;
    position: relative;
    overflow: hidden;
}

.btn-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-title {
    font-size: 14px;
    font-weight: 700;
}

.btn-subtitle {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
}

.btn-price {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.tag-minimal {
    background: rgba(0, 0, 0, 0.1);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    font-weight: normal;
}

.footer-info {
    margin-top: 18px;
    font-size: 12px;
    color: #999;
    background: #FAFAFA;
    padding: 8px;
    border-radius: 6px;
}

/* Toast */
.toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 300;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
}

/* --- Restored Project & Library Styles --- */
.lib-header {
    padding: 16px;
    background: transparent;
    position: relative;
    z-index: 20;
}

.lib-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.lib-tab {
    padding: 6px 16px;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.lib-tab.active {
    background: var(--black-accent);
    color: var(--gold-primary);
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.proj-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin: 0 16px 12px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    display: flex;
    gap: 12px;
    position: relative;
}

.proj-img {
    width: 80px;
    height: 80px;
    background: #F8F8F8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    position: relative;
}

.proj-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #FF3B30;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3);
}

.proj-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    background: #F0F0F0;
    color: #666;
    border-radius: 4px;
    font-size: 10px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.tag.gold {
    background: #FFF8E1;
    color: #B58900;
}

/* --- Adjusted Back Button Position --- */
.nav-back {
    position: absolute;
    left: 10px;
    bottom: 0;
    width: 44px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    z-index: 60;
    color: var(--black-accent);
}

/* --- Restored Tool Styles --- */
.tool-group-title {
    padding: 24px 20px 12px;
    font-size: 14px;
    font-weight: bold;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px;
}

.tool-item {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-item:active {
    transform: scale(0.98);
    background: #FAFAFA;
}

.tool-icon {
    font-size: 32px;
    margin-bottom: 12px;
    width: 50px;
    height: 50px;
    background: #F9F9F9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 11px;
    color: #999;
}

.vip-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #1A1A1A, #333);
    color: #C6A34F;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* --- Restored VIP Guide Styles --- */
.vip-wrap {
    padding: 0 16px 16px 16px;
}

.vip-card {
    background: linear-gradient(135deg, #1A1A1A, #2C2C2C);
    color: #FBF6E9;
    border-radius: 20px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.vip-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(198, 163, 79, 0.1) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

/* --- 统一项目列表样式 (Project Item Unified) --- */
.project-item {
    background: var(--bg-card);
    border-radius: var(--radius-box);
    padding: 16px;
    margin: 0 16px 12px 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    cursor: pointer;
}

.project-item:active {
    transform: scale(0.98);
}

.item-icon {
    width: 56px;
    height: 56px;
    background: #F2F3F5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-right: 16px;
    flex-shrink: 0;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-title-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.item-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-right: 8px;
}

.item-desc {
    font-size: 13px;
    color: #86909C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.item-tags {
    display: flex;
    gap: 6px;
}

/* Tag style override/update */
.tag {
    display: inline-block;
    padding: 3px 8px;
    background: #F7F8FA;
    color: #666;
    border-radius: 4px;
    font-size: 10px;
    margin-right: 0;
    /* managed by gap */
    margin-bottom: 0;
}

.tag.gold {
    background: #FFF8E1;
    color: #B58900;
}

.item-arrow {
    color: #DDD;
    font-size: 18px;
    margin-left: 10px;
}

/* Badges */
.badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-new {
    background: #FF4D4F;
    color: #fff;
}

.badge-vip {
    background: #1A1A1A;
    color: #D4AF37;
}

/* --- 计划详情页优化 (Plan Detail Polish) --- */
.plan-header-area {
    margin-bottom: 24px;
}

.plan-progress-track {
    height: 6px;
    background: #F0F0F0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
}

.plan-progress-fill {
    height: 100%;
    background: var(--success-color);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-progress-text {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    text-align: right;
}

.plan-step-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    gap: 16px;
    cursor: pointer;
    align-items: flex-start;
}

.plan-step-card:active {
    transform: scale(0.98);
    background: #FAFAFA;
}

.plan-step-card.done {
    background: #F9F9F9;
    box-shadow: none;
    border: 1px solid #F0F0F0;
}

.step-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #E0E0E0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-top: 2px;
    color: transparent;
}

.plan-step-card.done .step-checkbox {
    background: var(--success-color);
    border-color: var(--success-color);
    color: #fff;
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    transition: color 0.2s;
}

.plan-step-card.done .step-title {
    color: #999;
    text-decoration: line-through;
}

.step-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.plan-step-card.done .step-desc {
    color: #CCC;
}

/* --- New Buddy Card Style (Project List) --- */
:root {
    --bg-color: #F5F6F8;
    --card-white: #FFFFFF;
    --text-dark: #222222;
    --text-gray: #888888;
    --brand-gold: #FFC043;
    --brand-black: #333333;
    --success-green: #4BC668;
}

.buddy-card {
    background: var(--card-white);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    /* Clickable */
}

/* 1. Header */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.b-avatar {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    /* Added for Emojis */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
}

.project-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-dark);
}

.rec-badge {
    background: #FFF8E1;
    color: #B38F00;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rec-badge.grey {
    background: #F2F3F5;
    color: #666;
}

/* 2. Visual Stats */
.visual-stats {
    background: #F9FAFC;
    border-radius: 12px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

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

.stat-label {
    font-size: 12px;
    color: var(--text-gray);
    width: 60px;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #EAECEF;
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
}

.fill-gold {
    background: linear-gradient(90deg, #FFE082, #FFC107);
}

.fill-blue {
    background: linear-gradient(90deg, #CED2D9, #A0A9B5);
}

/* Slate Gray for Difficulty */

.stat-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
    width: 50px;
    text-align: right;
}

/* 3. Footer */
.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
}

.sop-steps {
    font-size: 11px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

.step-dot {
    width: 6px;
    height: 6px;
    background: #ddd;
    border-radius: 50%;
}

.step-dot.active {
    background: var(--success-green);
}

.action-btn {
    background: var(--brand-black);
    color: var(--brand-gold);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}