/* ============= 玄机阁 - 移动端品牌样式 ============= */
/* 品牌色板 */
:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --accent: #F59E0B;
    --accent-dark: #D97706;
    --dark: #1E1B4B;
    --dark-light: #312E81;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #e5e5e5;
    --bg: #F5F3FF;
    --card-bg: #FFFFFF;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow: 0 2px 12px rgba(139, 92, 246, 0.1);
    --shadow-lg: 0 8px 32px rgba(139, 92, 246, 0.15);
    --nav-height: 64px;
    --header-height: 56px;
    --status-height: 28px;
    --max-width: 450px;
}

/* 全局重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #1E1B4B 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 手机容器 */
.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
}

/* 状态栏 */
.status-bar {
    height: var(--status-height);
    background: var(--dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.status-bar .time {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.status-bar .status-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 头部导航 */
.app-header {
    height: var(--header-height);
    background: var(--dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: var(--status-height);
    z-index: 99;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.3s;
    padding: 6px;
}

.header-btn:active {
    opacity: 1;
}

.back-btn {
    color: #fff;
    padding: 6px;
    display: flex;
    align-items: center;
}

/* 主内容区域 */
.app-main {
    padding-bottom: calc(var(--nav-height) + 80px);
    min-height: calc(100vh - var(--header-height) - var(--status-height) - var(--nav-height));
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: var(--nav-height);
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    padding: 4px 8px;
    min-width: 48px;
    min-height: 44px;
    transition: color 0.3s;
    position: relative;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-center {
    position: relative;
    top: -12px;
}

.nav-center-btn {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.nav-center-btn svg {
    width: 28px;
    height: 28px;
}

/* Hero 区域 */
.hero-section {
    position: relative;
    padding: 40px 20px 48px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    overflow: hidden;
    text-align: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-logo {
    height: 48px;
    margin-bottom: 16px;
}

.hero-slogan {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero-desc {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    min-height: 44px;
    min-width: 44px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.45);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-outline:active {
    background: rgba(255,255,255,0.1);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

/* 分类导航 */
.category-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px;
    margin-top: -24px;
    position: relative;
    z-index: 2;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 12px 4px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.category-item:active {
    transform: scale(0.95);
}

.category-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

/* 区块通用 */
.section {
    padding: 20px 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
}

.section-more {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* 服务列表 */
.fortune-list {
    display: grid;
    gap: 12px;
}

.fortune-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 14px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.fortune-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.fortune-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fortune-card-info {
    flex: 1;
    min-width: 0;
}

.fortune-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.fortune-card-desc {
    font-size: 13px;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.fortune-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fortune-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.fortune-card-count {
    font-size: 12px;
    color: var(--text-muted);
}

.fortune-card-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #fff;
}

.status-active { background: #10B981; }
.status-inactive { background: #EF4444; }

/* 每日运势 */
.daily-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(245, 158, 11, 0.05));
}

.daily-date {
    font-size: 13px;
    color: var(--text-muted);
}

.daily-card {
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow-lg);
}

.daily-zodiac {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 64px;
}

.zodiac-icon {
    font-size: 32px;
}

.zodiac-name {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}

.daily-content {
    flex: 1;
}

.daily-content p {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 12px;
    line-height: 1.7;
}

.daily-lucky {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.lucky-color {
    font-weight: 600;
}

.lucky-num {
    font-weight: 600;
    color: var(--accent);
}

/* 关于区域 */
.about-section {
    background: var(--card-bg);
    border-radius: var(--radius) var(--radius) 0 0;
    margin-top: -8px;
    padding-top: 24px;
}

.about-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.about-card p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px 0 8px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.stat-item {
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

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

/* 页脚 */
.app-footer {
    background: var(--dark);
    padding: 24px 16px 16px;
    color: rgba(255,255,255,0.6);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-brand {
    text-align: center;
    margin-bottom: 20px;
}

.footer-logo {
    height: 36px;
    margin-bottom: 8px;
}

.footer-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

.footer-links a:active {
    color: #fff;
}

.footer-copyright {
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.footer-copyright p {
    margin-bottom: 4px;
}

/* ============= 服务详情页 ============= */
.detail-header {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    color: #fff;
}

.detail-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.detail-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-desc {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 13px;
    opacity: 0.7;
}

.detail-meta strong {
    color: var(--accent);
}

/* 表单 */
.form-section {
    padding: 20px 16px;
}

.form-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 16px;
}

.fortune-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
    background: var(--bg);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
}

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    transition: all 0.3s;
}

.radio-label:has(input:checked) {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
    color: var(--primary);
}

.radio-label input {
    display: none;
}

/* 结果区域 */
.result-section {
    padding: 0 16px 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
}

.result-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 20px;
}

.result-card {
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    border-radius: var(--radius);
    padding: 20px;
    color: #fff;
    line-height: 1.8;
}

.result-card p {
    margin-bottom: 8px;
    font-size: 14px;
    opacity: 0.9;
}

/* ============= 筛选标签 ============= */
.filter-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid var(--border);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    background: var(--card-bg);
    color: var(--text-light);
    transition: all 0.3s;
    min-height: 40px;
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.filter-btn:active {
    transform: scale(0.95);
}

/* ============= 个人中心 ============= */
.profile-card {
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    padding: 24px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.profile-email {
    font-size: 13px;
    opacity: 0.6;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px 16px;
    background: var(--card-bg);
    margin: 0 0 12px;
}

.profile-stats .stat-item {
    text-align: center;
}

.profile-stats .stat-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.profile-stats .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.profile-menu {
    padding: 0 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.menu-item:active {
    transform: scale(0.98);
    background: var(--bg);
}

.menu-icon {
    font-size: 20px;
    width: 36px;
    text-align: center;
}

.menu-item span:not(.menu-icon) {
    flex: 1;
    font-size: 15px;
}

.menu-item svg:last-child {
    flex-shrink: 0;
}

/* ============= 关于页 ============= */
.about-hero {
    text-align: center;
    padding: 32px 16px;
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    color: #fff;
}

.about-logo {
    height: 48px;
    margin-bottom: 12px;
}

.about-title {
    font-size: 26px;
    font-weight: 700;
}

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

.story-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg);
}

.story-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 8px;
}

.mission-list {
    display: grid;
    gap: 12px;
}

.mission-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-xs);
}

.mission-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.mission-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.mission-item p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 0;
}

/* 时间轴 */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg);
}

.timeline-content {
    background: var(--bg);
    border-radius: var(--radius-xs);
    padding: 12px;
}

.timeline-date {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
    padding: 2px 8px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
}

.timeline-content p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 0;
}

/* 团队 */
.team-list {
    display: grid;
    gap: 12px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-xs);
}

.team-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.team-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.team-info .team-title {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 2px;
}

.team-info .team-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============= 响应式 ============= */
@media (min-width: 768px) {
    .app-container {
        border-radius: 20px;
        margin: 20px auto;
        min-height: calc(100vh - 40px);
        overflow: hidden;
    }

    body {
        background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #1E1B4B 100%);
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 20px;
    }

    .hero-slogan {
        font-size: 36px;
    }

    .category-nav {
        gap: 12px;
        padding: 16px 20px;
    }

    .fortune-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .fortune-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============= 动画 ============= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 0.6s ease-out;
}

.category-nav .category-item {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.category-nav .category-item:nth-child(1) { animation-delay: 0.1s; }
.category-nav .category-item:nth-child(2) { animation-delay: 0.15s; }
.category-nav .category-item:nth-child(3) { animation-delay: 0.2s; }
.category-nav .category-item:nth-child(4) { animation-delay: 0.25s; }

/* ============= 滚动条美化 ============= */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

/* ============= 选择文本 ============= */
::selection {
    background: var(--primary);
    color: #fff;
}