/* 全局重置 */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #2c2c2c;
    display: flex; justify-content: center; align-items: center;
    height: 100vh; overflow: hidden;
}

/* --- 手机外壳 --- */
.phone-container {
    width: 375px; height: 750px;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    background-size: cover; background-position: center;
    border-radius: 40px;
    border: 5px solid #333; /* 细边框 */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
    color: #333;
    transition: all 0.5s ease;
}
.phone-container.fullscreen-mode {
    width: 100vw; height: 100vh; border: none; border-radius: 0; margin: 0;
}

/* --- 状态栏 --- */
.status-bar {
    height: 44px; display: flex; justify-content: space-between; align-items: center;
    padding: 0 25px; font-weight: 600; font-size: 14px; padding-top: 10px;
    position: relative; z-index: 100; color: inherit;
}
.battery-section { display: flex; align-items: center; gap: 5px; }
.battery-icon { display: flex; align-items: center; }
.battery-body {
    width: 22px; height: 10px; border: 1px solid #333; border-radius: 2px;
    padding: 1px; display: flex; align-items: center;
}
.battery-fill { height: 100%; background-color: #333; width: 100%; border-radius: 1px; }
.battery-head { width: 2px; height: 4px; background-color: #333; border-radius: 0 1px 1px 0; }

/* --- 磨砂玻璃通用样式 --- */
.glass-panel {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* --- 主屏幕内容区 --- */
.content-area {
    padding: 10px 20px;
    height: calc(100% - 44px - 110px); /* 减去状态栏和Dock */
    overflow-y: auto; scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }

/* 音乐播放器 */
.music-player {
    width: 100%; height: 120px; border-radius: 20px; margin-bottom: 0px;
    display: flex; padding: 15px; gap: 15px;
}
.album-cover {
    width: 90px; height: 90px; border-radius: 6px; /* 方正圆角 */
    background-color: rgba(255,255,255,0.3); border: 1px solid rgba(255,255,255,0.2);
    display: flex; justify-content: center; align-items: center;
    font-size: 12px; color: #666; cursor: pointer; overflow: hidden; position: relative; flex-shrink: 0;
}
#album-img-preview { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 2; }
.album-placeholder { z-index: 1; font-weight: 500; }
.player-controls { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.song-title { width: 100%; background: transparent; border: none; font-size: 16px; font-weight: bold; color: #333; outline: none; }
.progress-bar { width: 100%; height: 4px; background: rgba(0,0,0,0.1); border-radius: 2px; }
.progress-fill { width: 40%; height: 100%; background: #333; border-radius: 2px; }
.control-buttons { display: flex; justify-content: space-between; }
.btn-icon { background: none; border: none; font-size: 14px; cursor: pointer; color: #333; }

/* 中间层 (App + 拍立得) */
.middle-section { 
    display: flex; gap: 15px; height: 210px; align-items: center; 
    flex-shrink: 0; /* 防止被挤压 */
}
.grid-apps-left { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; justify-items: center; }
.app-item { display: flex; flex-direction: column; align-items: center; width: 55px; }
.app-icon-box {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; justify-content: center; align-items: center;
    color: #333; cursor: pointer; margin-bottom: 5px;
    transition: transform 0.1s; background-size: cover; background-position: center;
}
.app-icon-box:active { transform: scale(0.95); }
.app-icon-box svg { width: 22px; height: 22px; }
.app-icon-box.has-custom-icon svg { display: none; }
.app-name { font-size: 10px; color: #333; font-weight: 500; text-align: center; line-height: 1.2; }

/* 拍立得 */
.polaroid-group { flex: 1; position: relative; height: 100%; }
.polaroid-card {
    position: absolute; width: 65%; height: 65%; background-color: #fff;
    padding: 6px 6px 25px 6px; border-radius: 1px; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex; flex-direction: column; cursor: pointer; transition: transform 0.2s, z-index 0s;
}
.card-top-left { top: 5px; left: 5px; z-index: 10; transform: rotate(-3deg); }
.card-bottom-right { bottom: 5px; right: 5px; z-index: 5; transform: rotate(3deg); }
.polaroid-card:hover { transform: scale(1.05) rotate(0deg) !important; z-index: 20; box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.photo-frame {
    background-color: #f0f0f0; flex: 1; width: 100%;
    display: flex; justify-content: center; align-items: center; overflow: hidden; position: relative; border: 1px solid #ddd;
}
.preview-img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.placeholder-icon { font-size: 24px; color: #ccc; font-weight: bold; }

/* 底部层 (日记 + App) */
.lower-section { 
    display: flex; gap: 12px; height: 140px; align-items: center; 
    margin-top: 0; /* 归零，由 gap 控制 */
    flex-shrink: 0; /* 防止被挤压 */
}
.diary-group { width: 155px; height: 100%; display: flex; flex-direction: column; }
.diary-card {
    width: 100%; height: 100%; border-radius: 4px; background: rgba(255, 255, 255, 0.95);
    padding: 8px 10px; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.diary-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; border-bottom: 1px dashed rgba(0,0,0,0.08); padding-bottom: 4px; }
.user-info-box { display: flex; align-items: center; gap: 5px; max-width: 60%; }
.avatar-circle {
    width: 20px; height: 20px; border-radius: 50%; background-color: #e0e0e0; overflow: hidden;
    cursor: pointer; border: 1px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.1); flex-shrink: 0;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.user-text { display: flex; flex-direction: column; }
.user-name-input { background: transparent; border: none; font-size: 10px; font-weight: 700; color: #333; outline: none; width: 60px; line-height: 1.1; }
.user-id-input { background: transparent; border: none; font-size: 8px; color: #999; outline: none; width: 60px; line-height: 1.1; }
.date-box { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
#real-date { font-size: 8px; color: #888; font-weight: 500; white-space: nowrap; }
#real-year { font-size: 7px; color: #bbb; margin-top: -1px; }
.diary-content { flex: 1; position: relative; padding-top: 4px; }
.diary-content textarea { width: 100%; height: 100%; border: none; background: transparent; resize: none; outline: none; font-size: 10px; color: #444; line-height: 1.4; }
.diary-footer { display: flex; align-items: center; gap: 3px; color: #bbb; font-size: 9px; margin-top: 2px; }
.mini-clock-icon { width: 10px; height: 10px; }

.grid-apps-right { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; justify-items: center; align-items: center; }

/* --- Dock 栏 --- */
.dock-bar {
    position: absolute; bottom: 20px; left: 15px; right: 15px; height: 85px;
    border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.05);
    border-radius: 30px; backdrop-filter: blur(5px);
    display: flex; justify-content: space-around; align-items: center; padding: 0 10px;
}
.dock-bar .app-item { margin-bottom: 0; width: 50px; }
.dock-bar .app-icon-box { background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: none; }
.dock-bar .app-icon-box:active { background: rgba(255, 255, 255, 0.3); }
.dock-bar .app-name { margin-top: 4px; color: #444; font-weight: 500; }

/* =========================================
   === App 页面通用样式 (防白屏关键) ===
   ========================================= */
.app-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 50; background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    display: flex; flex-direction: column; padding-top: 44px; /* 避开状态栏 */
    transition: opacity 0.3s;
}
.hidden { display: none !important; }

/* App 头部 */
.app-header { height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 0 15px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.app-header h3 { font-size: 16px; color: #333; }
.back-btn {
    background: none; border: none; cursor: pointer; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.back-btn svg { width: 24px; height: 24px; fill: #333; }
.back-btn:active svg { opacity: 0.6; }

/* App 内容区 (修复：隐藏滚动条) */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    width: 100%;
    /* 隐藏滚动条的核心代码 👇 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
/* Chrome/Safari 隐藏滚动条 */
.app-content::-webkit-scrollbar {
    display: none;
}

/* 手风琴菜单 */
.accordion-item {
    background: rgba(255, 255, 255, 0.5); border-radius: 12px; margin-bottom: 15px;
    overflow: hidden; transition: all 0.3s;
}
.accordion-header {
    padding: 15px; display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; font-weight: bold; color: #333; font-size: 14px; background: rgba(255,255,255,0.3);
}
.accordion-header .arrow { font-size: 10px; transition: transform 0.3s; color: #999; }
.accordion-item.active .accordion-header .arrow { transform: rotate(180deg); }
.accordion-body {
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out;
    background: rgba(255,255,255,0.2);
}
.accordion-item.active .accordion-body { max-height: 500px; padding: 15px; border-top: 1px solid rgba(0,0,0,0.05); }

/* 控件样式 */
.control-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.input-text {
    width: 100%; padding: 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.6); font-size: 13px; outline: none; transition: all 0.2s;
}
.input-text:focus { background: #fff; border-color: #333; }

/* 黑色简约按钮 */
.btn-primary {
    padding: 8px 16px; border-radius: 6px;
    background-color: #111 !important; color: #fff !important;
    border: 1px solid #111 !important;
    font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s;
    white-space: nowrap; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.btn-primary:active { background-color: #444 !important; border-color: #444 !important; transform: scale(0.98); }

/* 壁纸预览框 (竖版) */
.wallpaper-preview {
    width: 120px; height: 220px; background-color: #eee; border-radius: 12px;
    background-size: cover; background-position: center; border: 2px solid #ddd;
    margin: 0 auto 15px auto; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 图标列表 */
.icon-upload-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.icon-upload-item { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.icon-preview {
    width: 40px; height: 40px; border-radius: 10px; background: #eee; border: 1px dashed #999;
    display: flex; justify-content: center; align-items: center; overflow: hidden; cursor: pointer;
}
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-label { font-size: 10px; color: #666; text-align: center; }

/* 开关组件 */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #333; }
input:checked + .slider:before { transform: translateX(20px); }

/* 设置列表样式 */
.settings-list-item {
    background: rgba(255, 255, 255, 0.5); padding: 15px; border-radius: 12px; margin-bottom: 10px;
    display: flex; justify-content: space-between; align-items: center; cursor: pointer; border: 1px solid rgba(0,0,0,0.05);
}
.settings-list-item:active { background: rgba(0,0,0,0.05); }
.settings-list-item .item-left { display: flex; align-items: center; gap: 10px; font-weight: 500; color: #333; }
.icon-box-small { font-size: 16px; }

/* 表单组 */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 12px; color: #666; margin-bottom: 6px; font-weight: bold; }
.divider { height: 1px; background: rgba(0,0,0,0.1); margin: 15px 0; }
.row-with-btn { display: flex; gap: 8px; }
.row-with-btn select { flex: 1; }
.button-group-vertical { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.btn-block { width: 100%; height: 40px; }
.btn-outline { background: transparent !important; border: 1px solid #111 !important; color: #111 !important; }

/* =========================================
   === 深色模式 (Dark Mode) ===
   ========================================= */
#my-phone.dark-mode .glass-panel,
#my-phone.dark-mode .app-icon-box, 
#my-phone.dark-mode .diary-card,
#my-phone.dark-mode .music-player {
    background: rgba(0, 0, 0, 0.6) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
#my-phone.dark-mode, #my-phone.dark-mode .app-name, #my-phone.dark-mode input, 
#my-phone.dark-mode textarea, #my-phone.dark-mode svg {
    color: #eee !important; fill: #eee !important;
}
#my-phone.dark-mode .battery-body { border-color: #eee; }
#my-phone.dark-mode .battery-head { background-color: #eee; }
#my-phone.dark-mode .battery-fill { background-color: #eee; }
#my-phone.dark-mode .progress-bar { background: rgba(255,255,255,0.2); }
#my-phone.dark-mode .progress-fill { background: #fff; }
#my-phone.dark-mode ::placeholder { color: rgba(255, 255, 255, 0.5) !important; }
#my-phone.dark-mode .dock-bar { background: rgba(0, 0, 0, 0.2); border-color: rgba(255, 255, 255, 0.1); }
#my-phone.dark-mode .dock-bar .app-icon-box { background: rgba(255, 255, 255, 0.1); }

/* 深色模式下的 App 页面 */
#my-phone.dark-mode .app-screen { background: rgba(0, 0, 0, 0.9) !important; color: #eee !important; }
#my-phone.dark-mode .back-btn svg { fill: #fff !important; } /* 返回箭头变白 */
#my-phone.dark-mode .settings-list-item { background: rgba(255, 255, 255, 0.1); border-color: rgba(255,255,255,0.1); }
#my-phone.dark-mode .settings-list-item .item-left { color: #eee; }
#my-phone.dark-mode .input-text { background: rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.2); color: #fff; }
#my-phone.dark-mode .btn-outline { border-color: #eee !important; color: #eee !important; }
/* --- 档案 App 样式 --- */

/* 头部右侧按钮 */
.icon-btn-right {
    background: none; border: none; cursor: pointer; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center; color: #333;
}
.icon-btn-right svg { width: 24px; height: 24px; }

/* 列表容器 */
.archive-list-container {
    display: flex; flex-direction: column; gap: 10px;
}
.empty-state {
    text-align: center; color: #999; font-size: 12px; margin-top: 50px; line-height: 1.5;
}

/* 列表项卡片 (List Item) */
.archive-item {
    background: rgba(255,255,255,0.6); padding: 10px; border-radius: 12px;
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    border: 1px solid rgba(0,0,0,0.05); transition: background 0.2s;
}
.archive-item:active { background: rgba(255,255,255,0.8); }
.archive-item-avatar {
    width: 45px; height: 45px; border-radius: 8px; background: #eee;
    object-fit: cover; border: 1px solid rgba(0,0,0,0.1);
}
.archive-item-info { display: flex; flex-direction: column; gap: 2px; }
.archive-name { font-size: 14px; font-weight: bold; color: #333; }
.archive-sub { font-size: 10px; color: #888; }

/* --- 编辑页布局 --- */
.section-title {
    font-size: 12px; font-weight: bold; color: #666; margin-bottom: 8px; margin-left: 4px;
}
.profile-card {
    margin-bottom: 15px;
}

/* 头像+输入框 横向布局 */
.profile-header-row {
    display: flex; gap: 12px; margin-bottom: 10px;
}
.profile-avatar-upload {
    width: 80px; height: 80px; background: rgba(255,255,255,0.5);
    border: 1px dashed #999; border-radius: 10px;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; overflow: hidden; position: relative; flex-shrink: 0;
}
.profile-avatar-upload img {
    width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0;
}
.profile-avatar-upload .plus-icon { font-size: 24px; color: #999; }

/* 右侧两行输入框 */
.profile-inputs-col {
    flex: 1; display: flex; flex-direction: column; justify-content: space-between;
}
/* 微调输入框高度，使其和头像对齐 */
.profile-inputs-col .input-text { height: 36px; }

/* 大文本框 */
.input-textarea {
    width: 100%; height: 120px; padding: 10px; border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1); background: rgba(255,255,255,0.6);
    outline: none; font-size: 12px; resize: none; line-height: 1.4; color: #333;
}
.input-textarea:focus { background: #fff; border-color: #333; }

/* 深色模式适配 */
#my-phone.dark-mode .icon-btn-right { color: #eee; }
#my-phone.dark-mode .archive-item { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.1); }
#my-phone.dark-mode .archive-name { color: #eee; }
#my-phone.dark-mode .input-textarea { background: rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.2); color: #eee; }
#my-phone.dark-mode .section-title { color: #aaa; }
/* =========================================
   === 档案卡片设计 (回归初心·纯黑版) ===
   ========================================= */

.id-card-paper {
    background-color: #fff;
    border: 1px solid #000; /* 还原：简单的黑色边框 */
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.1); /* 还原：简单的硬阴影 */
}

/* 顶部线 */
.card-top-line {
    width: 100%; height: 4px; 
    background-color: #000; /* 还原：纯黑 */
    margin-bottom: 8px;
}

/* 标题 */
.card-title {
    font-family: "Times New Roman", serif;
    font-weight: 900;
    font-size: 20px;
    text-transform: uppercase;
    color: #000; /* 还原：纯黑 */
    border-bottom: 1px solid #000; /* 还原：标题下有黑线 */
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* 中间行 */
.card-main-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

/* 左侧：照片 (原代码样式，位置换到了左边) */
.card-photo-col {
    width: 90px; height: 120px; /* 3:4 */
    background-color: #eee;
    border: 1px solid #000;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}
.photo-placeholder {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    color: #999; font-size: 9px; font-weight: bold;
}
.card-photo-col img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }

/* 右侧：信息栏 */
.card-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 撑开高度 */
    padding-bottom: 2px;
}

/* 单行 */
.card-field {
    display: flex;
    flex-direction: column; /* 还原：标签在输入框上面 */
    gap: 2px;
}

/* 标签 */
.card-field label {
    font-family: "Times New Roman", serif;
    font-size: 11px;
    font-weight: bold;
    color: #000;
}
.card-field label span { font-size: 10px; font-weight: normal; } /* 括号里的字小一点 */

/* 输入框 */
.card-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px dashed #000; /* 还原：黑色虚线 */
    border-radius: 0;
    padding: 2px 0;
    font-size: 12px;
    color: #000;
    outline: none;
    font-family: "Courier New", monospace;
}

/* 底部 */
.card-bottom-section {
    border-top: 1px dashed #ccc;
    padding-top: 10px;
}
.section-header {
    font-family: "Times New Roman", serif;
    font-size: 11px; font-weight: bold; color: #000;
    margin-bottom: 5px;
}
.card-textarea {
    width: 100%; height: 80px;
    background: transparent;
    border: 1px solid #ccc;
    padding: 5px; font-size: 12px; color: #000;
    resize: none; outline: none;
}

.divider-text {
    text-align: center; font-size: 10px; color: #999; letter-spacing: 2px; margin: 15px 0;
}

/* 深色模式简单反色 */
#my-phone.dark-mode .id-card-paper { background-color: #222; border-color: #555; }
#my-phone.dark-mode .card-top-line { background-color: #eee; }
#my-phone.dark-mode .card-title { color: #eee; border-color: #eee; }
#my-phone.dark-mode .card-field label { color: #ccc; }
#my-phone.dark-mode .card-input { color: #eee; border-bottom-color: #777; }
#my-phone.dark-mode .section-header { color: #ccc; }
#my-phone.dark-mode .card-textarea { color: #eee; border-color: #555; }
#my-phone.dark-mode .card-photo-col { border-color: #555; background-color: #333; }
/* =========================================
   === 世界书 App (档案袋风格) ===
   ========================================= */

/* 列表样式 (复用一点 Archive 的感觉，但图标不同) */
.world-list-container { display: flex; flex-direction: column; gap: 10px; }
.world-item {
    background: #fff; padding: 12px; border-radius: 8px;
    border-left: 5px solid #D1B7A1; /* 卡其色左标 */
    border: 1px solid #eee; border-left: 5px solid #D1B7A1;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.world-item-title { font-weight: bold; color: #444; font-size: 14px; }
.world-item-tag { 
    font-size: 10px; padding: 2px 6px; border-radius: 4px; 
    background: #f0f0f0; color: #888; margin-left: 5px;
}
.world-global-tag { background: #A18167; color: #fff; } /* 全局标 */

/* --- 编辑页：档案袋容器 --- */
.file-folder {
    background-color: #D1B7A1; /* 档案袋卡其色 */
    border-radius: 6px;
    padding: 10px;
    padding-top: 25px; /* 给 Tab 留位置 */
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-top: 15px;
}

/* 档案袋标签 (Tab) */
.folder-tab {
    position: absolute; top: -12px; right: 20px;
    background-color: #A18167; /* 深卡其 */
    color: #fff; font-size: 10px; font-weight: bold;
    padding: 4px 12px; border-radius: 4px 4px 0 0;
    letter-spacing: 1px;
}

/* --- 编辑页：信纸 (Paper) --- */
.folder-paper {
    background-color: #EFDCCC; /* 泛黄信纸色 */
    border-radius: 2px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: #5D4037; /* 深棕色文字，比黑色柔和 */
}

/* 字段组 */
.world-field-group { margin-bottom: 18px; }
.world-field-group label {
    display: block; font-size: 11px; font-weight: bold;
    color: #A18167; margin-bottom: 6px; text-transform: uppercase;
    font-family: "Times New Roman", serif;
}

/* 输入框 (信纸风格) */
.paper-input {
    width: 100%; background: transparent;
    border: none; border-bottom: 2px solid #D1B7A1;
    padding: 5px 0; font-size: 14px; font-weight: bold; color: #5D4037;
    outline: none; font-family: "Courier New", monospace;
}
.paper-input::placeholder { color: #C2B09F; }

/* 复选框 (自定义方形) */
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; }
.custom-checkbox {
    width: 16px; height: 16px; border: 2px solid #A18167; border-radius: 3px;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.custom-checkbox::after { content: "✔"; font-size: 12px; color: #fff; opacity: 0; transform: scale(0.5); transition: all 0.2s; }
.checkbox-row input:checked ~ .custom-checkbox { background-color: #A18167; }
.checkbox-row input:checked ~ .custom-checkbox::after { opacity: 1; transform: scale(1); }

/* 类别网格 */
.category-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-header { width: 100%; font-size: 9px; color: #A18167; opacity: 0.8; margin-bottom: 2px; }

/* 单选 Pill 样式 */
.radio-pill { cursor: pointer; }
.radio-pill input { display: none; }
.radio-pill span {
    display: inline-block; padding: 4px 10px; border: 1px solid #D1B7A1;
    border-radius: 12px; font-size: 11px; color: #8d7663; background: rgba(255,255,255,0.3);
    transition: all 0.2s;
}
.radio-pill input:checked + span {
    background-color: #A18167; color: #fff; border-color: #A18167;
}

/* 大文本框 */
.paper-textarea {
    width: 100%; height: 200px; /* 大！ */
    background: #fff; /* 稍微白一点，方便阅读 */
    border: 1px solid #fce5d1; border-radius: 4px;
    padding: 10px; font-size: 12px; line-height: 1.6; color: #5D4037;
    resize: none; outline: none;
    /* 信纸横线 */
    background-image: repeating-linear-gradient(transparent, transparent 23px, #EFDCCC 24px);
    line-height: 24px;
}

/* 深色模式适配 (稍微压暗颜色) */
#my-phone.dark-mode .file-folder { background-color: #5D4037; } /* 变为深皮色 */
#my-phone.dark-mode .folder-paper { background-color: #3E2723; color: #EFDCCC; }
#my-phone.dark-mode .paper-input { color: #EFDCCC; border-bottom-color: #8D6E63; }
#my-phone.dark-mode .paper-textarea { background-color: #4E342E; color: #EFDCCC; border-color: #5D4037; 
    background-image: repeating-linear-gradient(transparent, transparent 23px, #5D4037 24px);
}
#my-phone.dark-mode .world-item { background-color: #2a2a2a; border-color: #444; border-left-color: #8D6E63; }
#my-phone.dark-mode .world-item-title { color: #eee; }
/* =========================================
   === 世界书 App (修复版：档案袋风格) ===
   ========================================= */

/* 1. 列表项 */
.world-list-container { display: flex; flex-direction: column; gap: 10px; }
.world-item {
    background: #fff; padding: 15px; border-radius: 6px;
    border: 1px solid #ddd; border-left: 5px solid #A18167; /* 卡其色左标 */
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.world-item-title { font-weight: bold; color: #333; font-size: 14px; font-family: "FZXiaoBiaoSong", serif; }
.world-item-tag { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: #f4f4f4; color: #666; margin-left: 5px; }
.world-global-tag { background: #5D4037; color: #fff; } 

/* 2. 编辑页：外层档案袋 */
.file-folder {
    background-color: #D7CCC8; /* 档案袋底色 */
    border-radius: 4px;
    padding: 10px; 
    padding-top: 25px; 
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 15px;
    border: 1px solid #BCAAA4;
}

/* 顶部标签 Tab */
.folder-tab {
    position: absolute; top: -10px; left: 15px;
    background-color: #8D6E63; /* 深一点的卡其色 */
    color: #fff; font-size: 9px; font-weight: bold;
    padding: 3px 12px; border-radius: 4px 4px 0 0;
    letter-spacing: 1px;
}

/* 3. 编辑页：内层白纸 */
.world-sheet {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 20px;
    min-height: 400px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* 行间距 */
.world-row { margin-bottom: 25px; }

/* --- 字体层级 --- */
.w-label-main {
    display: block;
    font-family: "FZXiaoBiaoSong", "Times New Roman", serif;
    font-size: 13px; font-weight: bold; color: #5D4037;
    margin-bottom: 8px; border-left: 3px solid #D7CCC8; padding-left: 6px;
    line-height: 1;
}
.sub-category-group { margin-bottom: 12px; }
.w-label-sub { font-size: 11px; color: #999; margin-bottom: 6px; margin-left: 2px; }
.checkbox-text, .radio-pill span { font-size: 12px; font-family: sans-serif; }

/* --- 输入控件 --- */
/* 输入框：虚线 */
.sheet-input {
    width: 100%; background: transparent;
    border: none; border-bottom: 1px dashed #999;
    padding: 4px 0; font-size: 14px; color: #333;
    font-family: "Courier New", monospace; outline: none;
}
.sheet-input:focus { border-bottom: 1px solid #333; }

/* 文本域 */
.sheet-textarea {
    width: 100%; height: 180px;
    background: #fafafa; border: 1px solid #ddd;
    padding: 10px; font-size: 12px; color: #333;
    line-height: 1.6; resize: none; outline: none;
    font-family: "Courier New", monospace;
}

/* Checkbox */
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.custom-checkbox {
    width: 14px; height: 14px; border: 1px solid #333; border-radius: 2px;
    display: flex; align-items: center; justify-content: center;
}
.custom-checkbox::after { content: "✔"; font-size: 10px; color: #fff; opacity: 0; }
.checkbox-row input:checked ~ .custom-checkbox { background-color: #333; }
.checkbox-row input:checked ~ .custom-checkbox::after { opacity: 1; }

/* Radio Pills */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill input { display: none; }
.radio-pill span {
    display: inline-block; padding: 5px 14px;
    border: 1px solid #ccc; border-radius: 16px;
    color: #666; background: #fff; transition: all 0.2s;
}
.radio-pill input:checked + span {
    background-color: #333; color: #fff; border-color: #333;
}

/* 深色模式 */
#my-phone.dark-mode .file-folder { background-color: #4E342E; border-color: #3E2723; }
#my-phone.dark-mode .world-sheet { background-color: #212121; border-color: #444; }
#my-phone.dark-mode .w-label-main { color: #BCAAA4; border-left-color: #5D4037; }
#my-phone.dark-mode .sheet-input { color: #eee; border-bottom-color: #666; }
#my-phone.dark-mode .sheet-textarea { background-color: #333; border-color: #555; color: #eee; }
#my-phone.dark-mode .world-item { background: #333; border-color: #444; border-left-color: #8D6E63; }
#my-phone.dark-mode .world-item-title { color: #eee; }
/* --- 主屏幕内容区 (布局优化) --- */
.content-area {
    padding: 20px 20px; /* 顶部 padding 稍微加大 */
    height: calc(100% - 44px - 110px);
    overflow-y: auto; 
    scrollbar-width: none;
    
    /* 新增：使用 Flex 布局来控制垂直间距 */
    display: flex;
    flex-direction: column;
    gap: 25px; /* 关键：板块之间增加 25px 的间距，把内容撑开 */
}