/* ============================================================
   铁娘子 – 知识付费 H5 现代移动端样式体系
   ============================================================ */

/* -- CSS 变量体系 --------------------------------------------- */
:root {
    --primary: #e94560;
    --primary-dark: #c81d45;
    --text-primary: #1a1a2e;
    --text-secondary: #666;
    --text-hint: #999;
    --bg-page: #f5f5f5;
    --bg-card: #ffffff;
    --border: #eee;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* -- Reset & Base -------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, "PingFang SC", "Helvetica Neue",
        "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-card);
    position: relative;
}

/* -- 顶部导航栏 ----------------------------------------------- */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.nav-bar__back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    border: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-bar__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-bar__profile {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-bar__profile-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -- Loading 骨架屏 ------------------------------------------- */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 40px 24px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-spinner--small {
    width: 22px;
    height: 22px;
    border-width: 2px;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 骨架屏动画 */
.skeleton {
    width: 100%;
    max-width: 520px;
    padding: 24px 20px;
}

.skeleton__line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton__line--title {
    height: 26px;
    width: 80%;
    margin-bottom: 18px;
}

.skeleton__line--cover {
    height: 200px;
    width: 100%;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
}

.skeleton__line--meta {
    height: 12px;
    width: 50%;
    margin-bottom: 20px;
}

.skeleton__line--body-short { width: 95%; }
.skeleton__line--body-mid { width: 85%; }
.skeleton__line--body-long { width: 60%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading p {
    font-size: 14px;
    color: var(--text-hint);
    margin-top: 12px;
}

/* -- Error 状态页 --------------------------------------------- */
.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 65vh;
    text-align: center;
    padding: 40px 24px;
}

.error__illustration {
    width: 160px;
    height: 120px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.error h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.error p {
    font-size: 14px;
    color: var(--text-hint);
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 300px;
}

/* -- 按钮 ----------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 11px 28px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn--primary {
    background-color: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background-color: var(--primary-dark);
}

.btn--large {
    width: 100%;
    max-width: 300px;
    padding: 15px 28px;
    font-size: 17px;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* -- 文章容器 ------------------------------------------------- */
.article {
    background-color: var(--bg-card);
    min-height: 100vh;
    padding-bottom: 40px;
}

/* -- 文章头部 ------------------------------------------------- */
.article-header {
    padding: 24px 20px 18px;
}

.article-title {
    font-size: 23px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

/* 封面图区域 (16:9) */
#cover-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    background-color: var(--border);
    display: block;
}

#cover-image.placeholder {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    font-size: 13px;
}

/* 作者信息行 */
.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.publish-date {
    font-size: 12px;
    color: var(--text-hint);
}

.meta-stats {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-hint);
}

/* 分类标签 */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    background-color: rgba(233, 69, 96, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(233, 69, 96, 0.15);
}

/* -- 文章内容（富文本渲染）----------------------------------- */
.article-content {
    padding: 0 20px;
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-content p {
    margin-bottom: 1.3em;
    text-align: justify;
}

.article-content h2 {
    font-size: 21px;
    font-weight: 700;
    margin: 1.6em 0 0.8em;
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 1.3em 0 0.6em;
    color: var(--text-primary);
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.2em auto;
    border-radius: var(--radius-sm);
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 10px 18px;
    margin: 1em 0;
    background-color: rgba(233, 69, 96, 0.04);
    color: var(--text-secondary);
    font-style: normal;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content ul,
.article-content ol {
    margin: 1em 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 0.5em;
}

.article-content code {
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-family: "SFMono-Regular", Consolas, monospace;
}

.article-content pre {
    background-color: #1a1a2e;
    color: #e0e0e0;
    padding: 18px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1em 0;
    font-size: 14px;
    line-height: 1.6;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* -- 付费墙（重点美化）--------------------------------------- */
.paywall {
    position: relative;
    margin: 0 20px 30px;
    overflow: visible;
}

.paywall-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 0;
}

.paywall-divider::before,
.paywall-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--border) 20%,
        var(--border) 80%,
        transparent
    );
}

.paywall-divider-text {
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-hint);
    font-weight: 500;
    letter-spacing: 2px;
}

/* 模糊遮罩层 */
.blur-overlay {
    position: relative;
    margin-top: -40px;
    padding-top: 44px;
    height: 280px;
    background: linear-gradient(
        180deg,
        rgba(245, 245, 245, 0) 0%,
        rgba(255, 255, 255, 0.85) 35%,
        #fff 100%
    );
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 48px;
    z-index: 10;
}

/* 锁图标 */
.paywall-lock {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
}

/* 标题 */
.paywall-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

/* 描述 */
.paywall-desc {
    font-size: 14px;
    color: var(--text-hint);
    margin-bottom: 18px;
    line-height: 1.5;
    text-align: center;
    max-width: 260px;
}

/* 价格展示区 */
.paywall-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.paywall-price {
    font-size: 34px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.paywall-price .price-unit {
    font-size: 18px;
    font-weight: 600;
}

#original-price {
    font-size: 14px;
    color: var(--text-hint);
    text-decoration: line-through;
    font-weight: 400;
}

/* 购买人数社交证明 */
.purchase-proof {
    font-size: 13px;
    color: var(--text-hint);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.purchase-proof__count {
    color: var(--primary);
    font-weight: 600;
}

/* 支付按钮 */
.paywall-btn {
    width: 240px;
    padding: 14px 0;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary);
    border: none;
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.paywall-btn:active {
    transform: scale(0.97);
    background-color: var(--primary-dark);
}

/* 登录提示区域 */
.auth-section {
    text-align: center;
    margin-top: 16px;
}

.auth-tip {
    font-size: 13px;
    color: var(--text-hint);
    margin-bottom: 14px;
}

.login-btn {
    width: 220px;
    padding: 13px 0;
    font-size: 16px;
    font-weight: 600;
    color: #07c160;
    background-color: #fff;
    border: 2px solid #07c160;
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.login-btn:active {
    background-color: #07c160;
    color: #fff;
}

/* 已登录用户信息 */
.user-info-line {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.user-info-line strong {
    color: var(--text-primary);
}

/* 处理中状态 */
.processing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    margin-top: 10px;
}

.processing-text {
    font-size: 14px;
    color: var(--text-hint);
    margin-top: 10px;
}

/* -- 个人中心页面 -------------------------------------------- */
.profile-page {
    background-color: var(--bg-card);
    min-height: 100vh;
    padding-bottom: 40px;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px 28px;
    background: linear-gradient(180deg, var(--text-primary) 0%, #2a2a4e 100%);
    color: #fff;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #ff7b8f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.profile-nickname {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-id {
    font-size: 12px;
    opacity: 0.55;
}

/* 我的已购列表标题 */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 14px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-title__count {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-hint);
}

/* 已购卡片列表 */
.purchases-list {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.purchase-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid var(--border);
}

.purchase-card:active {
    transform: scale(0.98);
}

.purchase-card__thumb {
    width: 88px;
    height: 66px;
    border-radius: var(--radius-sm);
    background-color: var(--border);
    flex-shrink: 0;
    object-fit: cover;
}

.purchase-card__info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.purchase-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.purchase-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-hint);
}

.purchase-card__price {
    font-weight: 600;
    color: var(--primary);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    padding: 40px 24px;
}

.empty-state__icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-hint);
    line-height: 1.5;
}

/* -- 成功弹窗（毛玻璃效果）----------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.25s ease;
}

.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 42px 32px 34px;
    text-align: center;
    max-width: 320px;
    width: 88%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: modalPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalPop {
    from {
        transform: translateY(30px) scale(0.92);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #07c160, #06ae56);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 18px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(7, 193, 96, 0.3);
}

.modal-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 26px;
    line-height: 1.6;
}

/* -- 工具类 --------------------------------------------------- */
.hidden {
    display: none !important;
}
