:root {
    --bg-color: #FDFCF5;
    --primary-color: #F8E8A2; /* 奶油黄 */
    --primary-dark: #E6D485;
    --text-main: #3D3D3D;
    --text-sub: #8C8C8C;
    --card-bg: #FFFFFF;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --shadow-soft: 0 10px 30px rgba(240, 230, 140, 0.2);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.05);
    --font-serif: "Songti SC", "Noto Serif SC", "SimSun", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow: hidden; /* 防止页面整体滚动，由内部容器管理 */
    height: 100vh;
    width: 100vw;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 页面通用样式 */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    transform: scale(0.98);
    display: flex;
    flex-direction: column;
    z-index: 0;
}

.page.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    z-index: 10;
}

/* 启动页 */
#page-splash {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #FDFCF5 0%, #FFFDF0 100%);
}

.splash-content {
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.logo-circle {
    width: 100px;
    height: 100px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-soft);
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 48px;
    color: var(--text-main);
}

.app-title {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.app-slogan {
    font-size: 14px;
    color: var(--text-sub);
    letter-spacing: 1px;
}

/* 主页 */
#page-home {
    padding: 20px;
    overflow-y: auto;
}

.home-header {
    margin-top: 40px;
    margin-bottom: 30px;
}

.home-header h2 {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
}

.home-header p {
    color: var(--text-sub);
    font-size: 14px;
}

.font-grid {
    display: grid;
    grid-template-columns: 1fr; /* 手机端单列更清晰，或者双列 */
    gap: 20px;
    padding-bottom: 40px;
}

@media (min-width: 375px) {
    .font-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.font-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.font-card:active {
    transform: scale(0.96);
}

.card-preview {
    font-family: var(--font-serif);
    font-size: 64px;
    margin-bottom: 16px;
    color: var(--text-main);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FDFDFD;
    border-radius: 50%;
    border: 1px solid #F0F0F0;
}

.card-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
    font-weight: 500;
}

.card-info p {
    font-size: 12px;
    color: var(--text-sub);
}

/* 拍摄页 */
#page-camera {
    background-color: #000;
}

.camera-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    z-index: 1;
}

.camera-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #333, #111);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: absolute;
    z-index: 0;
}

.ar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none; /* 让点击穿透到底层 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.ar-text {
    font-family: var(--font-serif);
    font-size: 120px; /* 超大字 */
    writing-mode: vertical-rl; /* 竖排文字 */
    color: #000; /* 默认黑色墨迹 */
    opacity: 0.7; /* 默认透明度 */
    text-shadow: 0 0 2px rgba(255,255,255,0.2); /* 增加一点立体感 */
}

.camera-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px 15px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
    color: white;
}

.icon-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    z-index: 10;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 40px;
}

.slider-container {
    width: 80%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: white;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
}

.shutter-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: white;
    border: 4px solid rgba(255,255,255,0.5);
    background-clip: padding-box; /* 让border和content分开 */
    cursor: pointer;
    transition: transform 0.1s;
}

.shutter-btn:active {
    transform: scale(0.9);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
