/* ============================================================
   「乙述」品牌官网 - 全局样式
   风格调性：简约国风，低饱和配色，突出"传统历法科普"专业感
   配色方案：米白/浅灰/墨绿/赭石色系
   ============================================================ */

/* ---------- CSS 变量：统一管理颜色 ---------- */
:root {
    /* 主色调 */
    --color-bg:        #f5f4f2;        /* 宣纸底色 - 极浅暖灰 */
    --color-bg-alt:    #eae7e2;        /* 渐变辅助色 */
    --color-surface:   #fdfcf9;        /* 卡片/区块背景 */
    --color-text:      #1a1a1a;        /* 正文文字 */
    --color-text-light:#5c5c5c;        /* 辅助文字 */
    --color-muted:     #8c8c8c;        /* 更淡的文字 */
    --color-primary:   #c8923e;        /* 琥珀金主色 */
    --color-primary-hover: #a87a2e;    /* 琥珀金悬停 */
    --color-secondary: #5c4a3a;        /* 深棕辅助色 */
    --color-accent:    #d4a853;        /* 暖金点缀 */
    --color-border:    #e5e2dc;        /* 边框线条 */
    --color-bg-dark:   #1f1c18;        /* 深色背景（footer） */

    /* 语义色 */
    --color-success:   #4a8c5c;
    --color-warning:   #c9a03a;
    --color-error:     #b5453b;

    /* 尺寸 */
    --max-width:       1200px;
    --radius-sm:       6px;
    --radius-md:       12px;
    --radius-lg:       20px;
    --shadow-sm:       0 1px 4px rgba(0,0,0,0.06);
    --shadow-md:       0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:       0 8px 32px rgba(0,0,0,0.10);

    /* 字体 */
    --font-sans:       "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    --font-serif:      "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
    --font-mono:       "SF Mono", "Consolas", "Courier New", monospace;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: #f5f3ee;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* 主光晕：缓慢旋转的星云纹理 */
body::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140vmax;
    height: 140vmax;
    background: 
        radial-gradient(circle at 30% 30%, rgba(195,150,85,0.18) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(170,125,70,0.14) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(200,160,95,0.10) 0%, transparent 40%);
    animation: bgRotate 60s linear infinite;
    pointer-events: none;
    z-index: -1;
}

/* 次光晕：呼吸缩放 */
body::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vmax;
    height: 100vmax;
    background: radial-gradient(circle, rgba(210,170,100,0.12) 0%, transparent 70%);
    animation: bgBreathe 15s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes bgRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes bgBreathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1.0); opacity: 0.6; }
    50%      { transform: translate(-50%, -50%) scale(1.1); opacity: 0.9; }
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ---------- 通用布局 ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-light);
    font-size: 1rem;
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- 导航栏 ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 用CSS绘制的太极点缀图标 */
.nav-logo::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: conic-gradient(var(--color-primary) 0deg 180deg, var(--color-accent) 180deg 360deg);
    position: relative;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--color-text);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* 移动端菜单按钮 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    font-family: var(--font-sans);
}

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

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}
.btn-secondary:hover {
    background: var(--color-bg);
}

.btn-accent {
    background: var(--color-accent);
    color: #fff;
}
.btn-accent:hover {
    background: #b3915e;
    box-shadow: var(--shadow-md);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

/* ---------- 功能卡片 ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
    background: rgba(74, 107, 92, 0.08);
    color: var(--color-primary);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
}

.card-desc {
    font-size: 0.92rem;
    color: var(--color-text-light);
    line-height: 1.65;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--color-bg-dark);
    color: #c4b99a;
    padding: 40px 0 28px;
    margin-top: auto;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #c4b99a;
    font-size: 0.9rem;
}
.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    font-size: 0.82rem;
    color: #8a7d65;
    text-align: center;
}

/* ---------- Hero 区域 ---------- */
.hero {
    padding: 100px 0 80px;
    text-align: center;
}

.hero-logo {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 24px;
    letter-spacing: 0.15em;
}

.hero-tagline {
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: 40px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* ---------- 分割线 ---------- */
.divider {
    width: 48px;
    height: 3px;
    background: var(--color-accent);
    margin: 0 auto 32px;
    border-radius: 2px;
}

/* ---------- 小程序入口卡片 ---------- */
.miniapp-cta {
    background: linear-gradient(135deg, var(--color-primary) 0%, #3a5649 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    margin: 60px 0;
}

.miniapp-cta h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.miniapp-cta p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.miniapp-cta .btn {
    background: #fff;
    color: var(--color-primary);
    font-weight: 600;
}
.miniapp-cta .btn:hover {
    background: var(--color-accent);
    color: #fff;
}

/* ---------- 特色列表 ---------- */
.feature-list {
    max-width: 800px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--color-border);
    align-items: flex-start;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(74, 107, 92, 0.08);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-serif);
}

.feature-item h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 0.92rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* ---------- 合规页样式 ---------- */
.legal-content {
    max-width: 760px;
    margin: 0 auto;
}

.legal-content h1 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.legal-content h2 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--color-text);
    margin: 36px 0 14px;
}

.legal-content h3 {
    font-size: 1.05rem;
    color: var(--color-text);
    margin: 24px 0 10px;
}

.legal-content p,
.legal-content li {
    font-size: 0.94rem;
    color: var(--color-text-light);
    line-height: 1.8;
    margin-bottom: 12px;
}

.legal-content ul {
    list-style: disc;
    padding-left: 24px;
    margin-bottom: 16px;
}

.legal-content .update-date {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

/* ---------- 响应式设计 ---------- */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--color-surface);
        padding: 16px 24px;
        gap: 16px;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .section {
        padding: 48px 0;
    }

    .hero {
        padding: 60px 0 48px;
    }

    .hero-logo {
        font-size: 2.4rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        min-width: 0;
        padding: 16px;
    }

    .legal-content,
    .legal-content p,
    .legal-content li,
    .legal-content a,
    .feature-item > div {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .feature-item {
        flex-direction: column;
        gap: 12px;
    }

    .miniapp-cta {
        padding: 32px 24px;
    }

    .container {
        padding-left: max(var(--mobile-page-gutter), var(--safe-left));
        padding-right: max(var(--mobile-page-gutter), var(--safe-right));
    }
}

@media (max-width: 480px) {
    .hero-logo {
        font-size: 2rem;
    }
    .btn-lg {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

/* [主题迁移] css/style.css 旧版已完成的语义主题适配。 */
/* Semantic theme adapter: visual declarations only. */
html[data-theme="light"] body,
html[data-theme="dark"] body,
html[data-theme="light"] .app-shell,
html[data-theme="dark"] .app-shell,
html[data-theme="light"] main,
html[data-theme="dark"] main {
    background-color: var(--theme-canvas);
    color: var(--theme-text-1);
}

html[data-theme="dark"] body::before,
html[data-theme="dark"] body::after {
    background: var(--theme-canvas);
    opacity: .42;
}

html[data-theme="light"] .navbar,
html[data-theme="dark"] .navbar,
html[data-theme="light"] .sidebar,
html[data-theme="dark"] .sidebar,
html[data-theme="light"] .nav-links,
html[data-theme="dark"] .nav-links {
    background: var(--theme-canvas-alt);
    border-color: var(--theme-line);
    color: var(--theme-text-1);
}

html[data-theme="light"] .nav-logo,
html[data-theme="dark"] .nav-logo,
html[data-theme="light"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a:hover,
html[data-theme="light"] .nav-links a.active,
html[data-theme="dark"] .nav-links a.active {
    border-color: var(--theme-gold);
    color: var(--theme-gold);
}

html[data-theme="light"] .nav-links a,
html[data-theme="dark"] .nav-links a {
    color: var(--theme-text-1);
}

html[data-theme="light"] .nav-toggle span,
html[data-theme="dark"] .nav-toggle span {
    background: var(--theme-text-1);
}

html[data-theme="light"] input,
html[data-theme="dark"] input,
html[data-theme="light"] textarea,
html[data-theme="dark"] textarea,
html[data-theme="light"] select,
html[data-theme="dark"] select,
html[data-theme="light"] .search-input,
html[data-theme="dark"] .search-input,
html[data-theme="light"] .field,
html[data-theme="dark"] .field {
    background-color: var(--theme-surface-raised);
    border-color: var(--theme-line);
    caret-color: var(--theme-gold);
    color: var(--theme-text-1);
}

html[data-theme="light"] input:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="light"] textarea:focus-visible,
html[data-theme="dark"] textarea:focus-visible,
html[data-theme="light"] select:focus-visible,
html[data-theme="dark"] select:focus-visible,
html[data-theme="light"] .search-input:focus-visible,
html[data-theme="dark"] .search-input:focus-visible {
    border-color: var(--theme-gold);
    outline-color: var(--theme-gold);
    box-shadow: 0 0 0 3px var(--theme-gold-soft);
}

html[data-theme="light"] .card,
html[data-theme="dark"] .card,
html[data-theme="light"] .result-card,
html[data-theme="dark"] .result-card,
html[data-theme="light"] .login-card,
html[data-theme="dark"] .login-card,
html[data-theme="light"] .register-card,
html[data-theme="dark"] .register-card {
    background: var(--theme-surface);
    border-color: var(--theme-line);
    box-shadow: var(--theme-shadow);
    color: var(--theme-text-1);
}

html[data-theme="light"] .card:hover,
html[data-theme="dark"] .card:hover,
html[data-theme="light"] .result-card:hover,
html[data-theme="dark"] .result-card:hover {
    background: var(--theme-surface-raised);
    border-color: var(--theme-line-strong);
    box-shadow: var(--theme-shadow);
}

html[data-theme="light"] .card-icon,
html[data-theme="dark"] .card-icon,
html[data-theme="light"] .feature-num,
html[data-theme="dark"] .feature-num,
html[data-theme="light"] .tag,
html[data-theme="dark"] .tag,
html[data-theme="light"] .badge,
html[data-theme="dark"] .badge {
    background: var(--theme-pine-soft);
    border-color: var(--theme-pine);
    color: var(--theme-pine);
}

html[data-theme="light"] .btn,
html[data-theme="dark"] .btn,
html[data-theme="light"] .button,
html[data-theme="dark"] .button,
html[data-theme="light"] .btn-primary,
html[data-theme="dark"] .btn-primary {
    background: var(--theme-gold-soft);
    border-color: var(--theme-gold);
    color: var(--theme-text-1);
}

html[data-theme="light"] .btn-secondary,
html[data-theme="dark"] .btn-secondary,
html[data-theme="light"] .btn-accent,
html[data-theme="dark"] .btn-accent {
    background: var(--theme-surface-soft);
    border-color: var(--theme-line-strong);
    color: var(--theme-text-2);
}

html[data-theme="light"] .btn:hover,
html[data-theme="dark"] .btn:hover,
html[data-theme="light"] .button:hover,
html[data-theme="dark"] .button:hover {
    background: var(--theme-surface-soft);
    border-color: var(--theme-gold);
    color: var(--theme-gold);
    box-shadow: var(--theme-shadow);
}

html[data-theme="light"] .btn:disabled,
html[data-theme="dark"] .btn:disabled,
html[data-theme="light"] .button:disabled,
html[data-theme="dark"] .button:disabled,
html[data-theme="light"] input:disabled,
html[data-theme="dark"] input:disabled {
    background: var(--theme-surface-soft);
    border-color: var(--theme-line);
    color: var(--theme-text-disabled);
    opacity: .62;
}

html[data-theme="light"] .dialog,
html[data-theme="dark"] .dialog,
html[data-theme="light"] .modal,
html[data-theme="dark"] .modal,
html[data-theme="light"] .confirm,
html[data-theme="dark"] .confirm {
    background: var(--theme-surface-raised);
    border-color: var(--theme-line-strong);
    box-shadow: var(--theme-shadow);
    color: var(--theme-text-1);
}

html[data-theme="light"] .dialog-backdrop,
html[data-theme="light"] .modal-backdrop,
html[data-theme="light"] .confirm-backdrop {
    background: rgba(63, 52, 38, .28);
}

html[data-theme="dark"] .dialog-backdrop,
html[data-theme="dark"] .modal-backdrop,
html[data-theme="dark"] .confirm-backdrop {
    background: rgba(11, 15, 13, .58);
}

html[data-theme="light"] .toast,
html[data-theme="dark"] .toast,
html[data-theme="light"] .notification,
html[data-theme="dark"] .notification {
    background: var(--theme-surface-raised);
    border-color: var(--theme-line-strong);
    box-shadow: var(--theme-shadow);
    color: var(--theme-text-1);
}

html[data-theme="light"] table,
html[data-theme="dark"] table,
html[data-theme="light"] th,
html[data-theme="dark"] th,
html[data-theme="light"] td,
html[data-theme="dark"] td,
html[data-theme="light"] .list-row,
html[data-theme="dark"] .list-row,
html[data-theme="light"] .feature-item,
html[data-theme="dark"] .feature-item {
    background: var(--theme-surface);
    border-color: var(--theme-line);
    color: var(--theme-text-1);
}

html[data-theme="light"] .section-title,
html[data-theme="dark"] .section-title,
html[data-theme="light"] .hero-logo,
html[data-theme="dark"] .hero-logo,
html[data-theme="light"] .legal-content h1,
html[data-theme="dark"] .legal-content h1 {
    color: var(--theme-gold);
}

html[data-theme="light"] .section-subtitle,
html[data-theme="dark"] .section-subtitle,
html[data-theme="light"] .card-desc,
html[data-theme="dark"] .card-desc,
html[data-theme="light"] .hero-tagline,
html[data-theme="dark"] .hero-tagline,
html[data-theme="light"] .feature-item p,
html[data-theme="dark"] .feature-item p,
html[data-theme="light"] .legal-content p,
html[data-theme="dark"] .legal-content p,
html[data-theme="light"] .legal-content li,
html[data-theme="dark"] .legal-content li {
    color: var(--theme-text-2);
}

html[data-theme="light"] .footer,
html[data-theme="dark"] .footer {
    background: var(--theme-canvas-alt);
    border-color: var(--theme-line);
    color: var(--theme-text-2);
}

html[data-theme="light"] .footer-links a,
html[data-theme="dark"] .footer-links a,
html[data-theme="light"] .footer-copy,
html[data-theme="dark"] .footer-copy {
    color: var(--theme-text-3);
}

