/* ===== 全局重置 & 核心样式 ===== */
body { margin: 0; padding: 0; background-color: #0d0d0d; font-family: -apple-system, BlinkMacSystemFont, sans-serif; color: white; overflow: hidden; }
.screen { width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; display: none; flex-direction: column; background: #0d0d0d; }
.active { display: flex; }

/* ===== 状态栏 & 主屏幕 ===== */
.status-bar { display: flex; justify-content: space-between; padding: 15px 20px; font-size: 14px; font-weight: bold; background: transparent; }

.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px 15px; padding: 30px 20px; flex: 1; pointer-events: none; }
.app-icon { display: flex; flex-direction: column; align-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; pointer-events: auto; align-self: start; justify-self: center; }

.icon-box { width: 56px; height: 56px; border-radius: 14px; display: flex; justify-content: center; align-items: center; font-size: 26px; background: #333; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.1s; }
.icon-box:active { transform: scale(0.95); }
.app-name { font-size: 12px; margin-top: 8px; color: #ccc; }

.dock { position: absolute; bottom: 30px; left: 5%; width: 90%; height: 90px; background: rgba(40,40,40,0.8); backdrop-filter: blur(10px); border-radius: 25px; display: flex; justify-content: space-around; align-items: center; }
.dock .app-icon { align-self: center; justify-self: center; }
.dock .icon-box { width: 48px; height: 48px; font-size: 24px; }
.dock .app-name { font-size: 11px; margin-top: 4px; }

/* ===== App 图标主题色 ===== */
.notes .icon-box { background: linear-gradient(135deg, #f5d76e, #e6b91e); }
.gallery .icon-box { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.calendar .icon-box { background: linear-gradient(135deg, #e0eafc, #cfdef3); color: black; }
.xhs .icon-box { background: linear-gradient(135deg, #ff2a2a, #cc0000); }
.messages .icon-box { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.browser .icon-box { background: linear-gradient(135deg, #4da8da, #2980b9); }
.shop .icon-box { background: linear-gradient(135deg, #ff7e5f, #e74c3c); }
/* 新增小说App图标 */
.novel .icon-box { background: linear-gradient(135deg, #56ab2f, #a8e063); }

.app-icon { -webkit-tap-highlight-color: transparent; }

/* ===== 应用内通用头部 ===== */
.app-header { padding: 15px 20px; background: #1a1a1a; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; flex-shrink: 0; }
.back-btn, .action-btn { font-size: 14px; cursor: pointer; padding: 6px 12px; background: #333; border-radius: 8px; color: white; border: none; }
.app-content { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; width: 100%; box-sizing: border-box; }

/* ===== 备忘录专用样式 ===== */
.note-list-item { background: #222; padding: 15px; border-radius: 12px; margin-bottom: 15px; cursor: pointer; width: 100%; box-sizing: border-box; }
.note-list-title { font-weight: bold; font-size: 16px; margin-bottom: 5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-list-date { font-size: 12px; color: #888; margin-bottom: 8px; }
.note-list-preview { font-size: 14px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#note-editor { width: 100%; height: 80%; background: #222; color: white; border: none; padding: 15px; border-radius: 12px; font-size: 16px; line-height: 1.5; resize: none; box-sizing: border-box; display: none; }
#note-editor:focus { outline: none; }
.add-note-btn { position: absolute; bottom: 30px; right: 30px; width: 60px; height: 60px; border-radius: 30px; background: #e6b91e; color: #000; font-size: 30px; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.5); cursor: pointer; display: none; z-index: 10; }
.add-note-btn:active { transform: scale(0.95); }

/* ===== 弹窗样式 ===== */
#rhys-alert { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 90%; background: rgba(255, 255, 255, 0.95); color: #000; padding: 20px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 999; display: none; text-align: center; font-weight: bold; }
.alert-btn { margin-top: 15px; padding: 8px 20px; background: #000; color: #fff; border-radius: 20px; display: inline-block; cursor: pointer; }

/* ===== 其他 App 占位样式（保留） ===== */
.xhs-profile { display: flex; flex-direction: column; align-items: center; width: 100%; }
.xhs-avatar { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #ff6b6b, #ee5a24); display: flex; justify-content: center; align-items: center; font-size: 40px; color: white; margin-bottom: 10px; }
.xhs-name { font-size: 20px; font-weight: bold; }
.xhs-bio { font-size: 14px; color: #888; margin: 5px 0 15px 0; }
.xhs-stats { display: flex; gap: 40px; justify-content: center; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 15px; width: 100%; }
.xhs-stats div { display: flex; flex-direction: column; align-items: center; }
.xhs-stats .num { font-weight: bold; font-size: 18px; }
.xhs-stats .label { font-size: 12px; color: #888; }
.xhs-empty { color: #555; margin-top: 40px; font-size: 14px; text-align: center; width: 100%; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; }
.gallery-grid .empty-box { aspect-ratio: 1; background: #1a1a1a; border-radius: 4px; border: 1px dashed #333; display: flex; justify-content: center; align-items: center; color: #333; font-size: 24px; }
.gallery-empty-text { color: #555; margin-top: 30px; font-size: 14px; text-align: center; width: 100%; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; width: 100%; margin-bottom: 20px; }
.cal-header { text-align: center; font-weight: bold; color: #666; font-size: 14px; }
.cal-day { text-align: center; padding: 8px 0; border-radius: 25px; font-size: 14px; background: transparent; }
.cal-day.other-month { color: #333; }
.cal-day.today { background: #e6b91e; color: #000; font-weight: bold; }
.cal-section-title { font-size: 16px; font-weight: bold; margin: 15px 0 8px 0; width: 100%; border-bottom: 1px solid #333; padding-bottom: 5px; }
.cal-empty { color: #555; font-size: 14px; width: 100%; }
.msg-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; width: 100%; color: #555; }
.msg-empty-icon { font-size: 60px; margin-bottom: 20px; opacity: 0.4; }
.msg-empty-text { font-size: 16px; }
.browser-search { width: 100%; padding: 10px 15px; background: #1a1a1a; border-radius: 12px; color: #555; margin-bottom: 20px; border: 1px solid #333; box-sizing: border-box; }
.browser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; width: 100%; margin-bottom: 20px; }
.browser-grid .empty-site { aspect-ratio: 1; background: #1a1a1a; border-radius: 12px; border: 1px dashed #333; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #444; font-size: 12px; }
.browser-grid .empty-site .icon { font-size: 28px; }
.browser-history-title { font-size: 14px; color: #888; width: 100%; margin-bottom: 5px; }
.browser-history-empty { color: #555; font-size: 14px; width: 100%; }

/* ================================================================
   v3.1.0 商店系统样式（沿用）
   ================================================================ */
.shop-container { width: 100%; display: flex; flex-direction: column; height: 100%; }
.shop-header { display: flex; justify-content: space-between; align-items: center; width: 100%; padding-bottom: 10px; border-bottom: 1px solid #333; flex-shrink: 0; }
.shop-search { flex: 1; background: #1a1a1a; border: 1px solid #333; border-radius: 20px; padding: 8px 15px; color: #888; font-size: 14px; cursor: pointer; margin-right: 10px; }
.shop-search:focus { outline: none; border-color: #e6b91e; }
.shop-header-right { display: flex; align-items: center; gap: 12px; }
.shop-balance { font-size: 14px; font-weight: bold; color: #e6b91e; }
.shop-settings-btn { font-size: 22px; cursor: pointer; background: none; border: none; color: #888; padding: 0; line-height: 1; }

.shop-bottom-nav { display: flex; justify-content: space-around; background: #1a1a1a; padding: 10px 0 8px; border-top: 1px solid #333; flex-shrink: 0; width: 100%; margin-top: auto; }
.shop-nav-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; color: #666; font-size: 11px; transition: 0.2s; background: none; border: none; padding: 0 10px; position: relative; }
.shop-nav-item.active { color: #e6b91e; }
.shop-nav-item .nav-icon { font-size: 22px; margin-bottom: 2px; }

.shop-tab-content { flex: 1; overflow-y: auto; width: 100%; padding-top: 12px; display: none; flex-direction: column; }
.shop-tab-content.active { display: flex; }

.shop-item { background: #1a1a1a; border-radius: 12px; padding: 15px; margin-bottom: 12px; width: 100%; box-sizing: border-box; display: flex; gap: 14px; align-items: center; }
.shop-item-icon { font-size: 40px; flex-shrink: 0; width: 48px; text-align: center; }
.shop-item-info { flex: 1; min-width: 0; }
.shop-item-name { font-weight: bold; font-size: 16px; }
.shop-item-desc { font-size: 12px; color: #888; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-item-price { font-size: 14px; color: #e6b91e; margin-top: 4px; }
.shop-item-secret { color: #ff6b6b; font-size: 11px; background: #2a0a0a; padding: 2px 10px; border-radius: 10px; display: inline-block; margin-top: 3px; }
.shop-item-actions { flex-shrink: 0; }
.shop-btn { padding: 6px 16px; border-radius: 20px; border: none; font-size: 13px; cursor: pointer; background: #333; color: white; }
.shop-btn.primary { background: #e6b91e; color: #000; }
.shop-btn.danger { background: #e74c3c; color: white; }
.shop-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.cart-item { background: #1a1a1a; border-radius: 8px; padding: 10px 15px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box; }
.cart-empty, .orders-empty, .recommend-empty { color: #555; padding: 40px 0; text-align: center; width: 100%; font-size: 15px; }

.order-item { background: #1a1a1a; border-radius: 8px; padding: 12px 15px; margin-bottom: 10px; width: 100%; box-sizing: border-box; }
.order-header { display: flex; justify-content: space-between; font-size: 14px; }
.order-detail { font-size: 13px; color: #aaa; margin-top: 5px; white-space: pre-wrap; word-break: break-word; }
.order-review { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.order-review input { flex: 1; padding: 6px 10px; border-radius: 20px; border: 1px solid #333; background: #222; color: white; min-width: 100px; }

#settings-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1000; display: none; justify-content: center; align-items: center; }
#settings-modal .modal-box { background: #1a1a1a; border-radius: 16px; padding: 25px; width: 85%; max-width: 340px; }
#settings-modal .modal-box h3 { margin-top: 0; }
#settings-modal .modal-box .modal-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #333; }
#settings-modal .modal-box .modal-row:last-child { border-bottom: none; }

#restock-form { display: none; flex-direction: column; width: 100%; margin-top: 12px; }
#restock-form input, #restock-form textarea, #restock-form select { padding: 10px; margin-bottom: 10px; border-radius: 8px; border: 1px solid #333; background: #222; color: white; font-size: 14px; width: 100%; box-sizing: border-box; }
#restock-form textarea { min-height: 60px; resize: vertical; }
#restock-form .form-row { display: flex; gap: 10px; }
#restock-form .form-row input { flex: 1; }
#restock-form .form-label { font-size: 12px; color: #888; margin-bottom: 2px; margin-top: 4px; }

/* ================================================================
   v3.3.2 小说App新增样式
   ================================================================ */
.novel-tabs { display: flex; width: 100%; border-bottom: 1px solid #333; margin-bottom: 15px; }
.novel-tab { flex: 1; text-align: center; padding: 12px 0; cursor: pointer; color: #888; border-bottom: 2px solid transparent; }
.novel-tab.active { color: #56ab2f; border-bottom: 2px solid #56ab2f; font-weight: bold; }

.novel-item { background: #1a1a1a; border-radius: 12px; padding: 15px; margin-bottom: 12px; width: 100%; box-sizing: border-box; display: flex; gap: 14px; align-items: center; }
.novel-cover { width: 60px; height: 80px; border-radius: 6px; background: linear-gradient(135deg, #56ab2f, #a8e063); display: flex; justify-content: center; align-items: center; color: #fff; font-size: 14px; flex-shrink: 0; }
.novel-info { flex: 1; min-width: 0; }
.novel-title { font-weight: bold; font-size: 16px; color: #fff; }
.novel-desc { font-size: 12px; color: #888; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.novel-meta { font-size: 11px; color: #aaa; margin-top: 8px; }
.novel-actions { flex-shrink: 0; display: flex; flex-direction: column; gap: 5px; }

.novel-chapter-list { width: 100%; }
.chapter-item { padding: 15px; background: #1a1a1a; border-bottom: 1px solid #333; cursor: pointer; display: flex; justify-content: space-between; }
.chapter-item:last-child { border-bottom: none; }

#novel-reader { width: 100%; height: 100%; overflow-y: auto; }
#novel-reader h1 { font-size: 22px; margin-bottom: 20px; }
#novel-reader p { line-height: 1.8; font-size: 16px; margin-bottom: 15px; color: #ddd; }
.novel-reader-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

#create-novel-form { display: none; flex-direction: column; width: 100%; margin-top: 12px; background: #1a1a1a; padding: 15px; border-radius: 12px; box-sizing: border-box; }
#create-novel-form input, #create-novel-form textarea { padding: 10px; margin-bottom: 10px; border-radius: 8px; border: 1px solid #333; background: #222; color: white; font-size: 14px; width: 100%; box-sizing: border-box; }