/* ===== 淡紫白 · 涂鸦风 ===== */
:root {
  --bg: #f7f4fc; --card: #ffffff; --text: #4a4060; --text2: #7a7090; --text3: #a89fc0;
  --line: #ece6f5; --shadow: 0 2px 10px rgba(168,138,218,0.10); --radius: 20px;
  --lilac: #b8a9e0; --lilac-d: #a78bda; --lilac-l: #e8def8;
  --en: #a78bda; --py: #7ec4cf; --ai: #e0a0c0; --idea: #f0c060; --film: #f5a0b5;
  --media: #90c0e0; --body: #a0c0b0; --fit: #c0a0e0; --good: #f0b0a0; --movie: #b0a0e0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
.muted { color: var(--text3); font-size: 0.8rem; }
.ex { color: var(--text3); font-size: 0.78rem; font-style: italic; }

/* ===== 开屏 ===== */
.splash { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; text-align: center; background: linear-gradient(160deg, #f3edfb 0%, #faf6ff 50%, #fdeef4 100%); transition: opacity 0.5s ease; padding: 24px; }
.splash.fade-out { opacity: 0; }
.splash-flower { font-size: 4rem; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(4deg); } }
.splash-quote { font-size: 1.25rem; font-weight: 600; color: var(--lilac-d); max-width: 280px; line-height: 1.8; }
.splash-date { font-size: 0.82rem; color: var(--text3); }
.splash-enter { border: none; background: var(--lilac-d); color: #fff; font-size: 1rem; font-weight: 600; padding: 14px 32px; border-radius: 30px; cursor: pointer; box-shadow: 0 6px 20px rgba(167,139,218,0.4); transition: transform 0.2s; font-family: inherit; }
.splash-enter:hover { transform: translateY(-2px); }
.splash-enter:active { transform: scale(0.96); }

/* ===== 布局 ===== */
.app { display: flex; min-height: 100vh; }
.side-doodle { width: 120px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: linear-gradient(180deg, var(--lilac-l), #f7f4fc); border-right: 2px dashed var(--line); padding: 16px; }
.doodle-svg { width: 100%; max-width: 100px; }
.side-quote { font-size: 0.76rem; color: var(--lilac-d); text-align: center; font-weight: 500; background: #fff; padding: 8px 12px; border-radius: 14px; box-shadow: var(--shadow); border: 1px dashed var(--lilac); line-height: 1.5; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 顶部搜索栏 */
.top-bar { position: sticky; top: 0; z-index: 50; background: rgba(247,244,252,0.92); backdrop-filter: blur(10px); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search-wrap { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px; box-shadow: var(--shadow); }
.search-ico { font-size: 1rem; }
.search-input { flex: 1; border: none; outline: none; background: none; font-size: 0.92rem; font-family: inherit; color: var(--text); }
.search-clear { border: none; background: var(--lilac-l); color: var(--lilac-d); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 0.8rem; flex-shrink: 0; }

/* 搜索结果 */
.search-results { padding: 12px 16px 24px; }
.search-item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); border: 1px solid var(--line); }
.si-icon { font-size: 1.4rem; }
.si-body { flex: 1; min-width: 0; }
.si-type { font-size: 0.7rem; color: var(--lilac-d); font-weight: 600; }
.si-title { font-weight: 600; font-size: 0.92rem; }
.si-desc { font-size: 0.76rem; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 竖排板块 */
.board { padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 10px; }
.board-item { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 16px; padding: 16px 18px; cursor: pointer; box-shadow: var(--shadow); border: 1px solid var(--line); border-left: 4px solid var(--lilac); transition: transform 0.15s; position: relative; }
.board-item:hover { transform: translateX(2px); }
.board-item:active { transform: scale(0.99); }
.board-item.en { border-left-color: var(--en); }
.board-item.py { border-left-color: var(--py); }
.board-item.ai { border-left-color: var(--ai); }
.board-item.idea { border-left-color: var(--idea); }
.board-item.film { border-left-color: var(--film); }
.board-item.media { border-left-color: var(--media); }
.board-item.body { border-left-color: var(--body); }
.board-item.fit { border-left-color: var(--fit); }
.board-item.good { border-left-color: var(--good); }
.board-item.movie { border-left-color: var(--movie); }
.bi-icon { font-size: 1.8rem; flex-shrink: 0; }
.bi-body { flex: 1; min-width: 0; }
.bi-title { font-size: 1.05rem; font-weight: 700; }
.bi-desc { font-size: 0.78rem; color: var(--text3); }
.bi-badge { font-size: 0.7rem; padding: 2px 10px; border-radius: 12px; background: var(--lilac-l); color: var(--lilac-d); font-weight: 500; flex-shrink: 0; }
.bi-arrow { font-size: 1.4rem; color: var(--text3); flex-shrink: 0; }

/* ===== 全屏页面 ===== */
.page-container { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; }
.page-container.hidden { display: none; }
.page { display: flex; flex-direction: column; height: 100%; --pc: var(--lilac); }
.page-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 3px solid var(--pc); padding-top: calc(12px + env(safe-area-inset-top)); }
.page-back { border: none; background: var(--pc); color: #fff; font-size: 0.9rem; font-weight: 600; padding: 8px 16px; border-radius: 14px; cursor: pointer; font-family: inherit; }
.page-title { font-size: 1.15rem; font-weight: 800; color: var(--pc); }
.page-body { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }

/* 通用组件 */
.seg { display: flex; gap: 3px; background: var(--bg); border-radius: 12px; padding: 3px; margin-bottom: 16px; position: sticky; top: 0; z-index: 5; }
.seg-btn { flex: 1; padding: 8px 4px; border: none; background: none; border-radius: 9px; font-size: 0.8rem; cursor: pointer; color: var(--text2); font-weight: 500; font-family: inherit; white-space: nowrap; }
.seg-btn.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px; border-radius: 12px; border: none; font-size: 0.85rem; cursor: pointer; font-weight: 500; font-family: inherit; transition: all 0.15s; }
.btn-primary { background: var(--lilac-d); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-outline { background: var(--bg); color: var(--text); }
.btn-outline:hover { background: var(--lilac-l); }
.btn-sm { padding: 5px 10px; font-size: 0.76rem; border-radius: 9px; }
.btn-danger { background: #fff; color: #e88; border: 1px solid #fdd; }
.btn-danger:hover { background: #fef2f2; }
.input { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 0.9rem; outline: none; background: var(--bg); font-family: inherit; transition: border-color 0.15s; }
.input:focus { border-color: var(--lilac); }

/* 盒子/卡片项 */
.box { background: var(--bg); border-radius: 14px; padding: 14px; margin-bottom: 10px; border-left: 3px solid var(--lilac); }
.box-tag { display: inline-block; font-size: 0.72rem; padding: 2px 8px; border-radius: 8px; background: var(--lilac-l); color: var(--lilac-d); margin-bottom: 6px; font-weight: 600; }
.box-q { font-size: 0.9rem; margin: 4px 0; }
.box-a { font-size: 0.82rem; color: var(--text2); margin-top: 4px; }
.box-ans { font-size: 0.82rem; color: var(--lilac-d); font-weight: 600; margin-top: 4px; }
.kv-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.topic-block { margin-bottom: 16px; }
.topic-head { font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; color: var(--lilac-d); }
.check-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; }
.check-item:hover { background: var(--bg); }
.check-item input { width: 17px; height: 17px; accent-color: var(--lilac-d); }
.code { background: #2d2a3a; color: #e8def8; border-radius: 10px; padding: 12px 14px; font-family: "SF Mono", Consolas, monospace; font-size: 0.78rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 6px 0; }
.tool-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg); margin-bottom: 8px; }
.tool-icon { font-size: 1.5rem; flex-shrink: 0; }
.tool-info { flex: 1; min-width: 0; }
.tool-name { font-weight: 600; font-size: 0.9rem; }
.tool-desc { font-size: 0.76rem; color: var(--text3); }
.empty { text-align: center; color: var(--text3); padding: 36px 20px; font-size: 0.9rem; }

/* 备忘录 */
.memo-pad { margin-top: 4px; }
.memo-input-row { display: flex; gap: 8px; margin-bottom: 0; }
.memo-actions { display: flex; gap: 8px; margin: 8px 0 14px; }
.memo-list { display: flex; flex-direction: column; gap: 10px; }
.memo-item { background: #fff; border-radius: 14px; padding: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); border-left: 4px solid var(--lilac); }
.memo-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.status-pill { font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; color: #fff; font-weight: 500; }
.memo-tag { font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; background: var(--lilac-l); color: var(--lilac-d); }
.memo-time { font-size: 0.72rem; color: var(--text3); margin-left: auto; }
.memo-del { border: none; background: none; color: var(--text3); font-size: 0.9rem; cursor: pointer; margin-left: 4px; }
.memo-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.memo-content { font-size: 0.88rem; color: var(--text2); white-space: pre-wrap; line-height: 1.7; }
.memo-img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; margin-top: 8px; }

/* 视频 */
.va-row { display: flex; gap: 8px; margin-bottom: 8px; }
.va-row .input { flex: 1; }
.video-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px; }
@media (min-width: 680px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
.video-item { background: var(--bg); border-radius: 14px; padding: 12px; }
.vi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.vi-badge { font-size: 0.72rem; padding: 2px 8px; border-radius: 8px; flex-shrink: 0; }
.vi-badge.bilibili { background: #fde8f3; color: #e84393; }
.vi-badge.douyin { background: #e8f8f8; color: #00b894; }
.vi-badge.youtube { background: #fde8e8; color: #e74c3c; }
.vi-title { font-weight: 600; font-size: 0.88rem; }
.vi-note { font-size: 0.78rem; color: var(--text3); margin-bottom: 8px; }
.video-embed { position: relative; width: 100%; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.video-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; width: 100%; padding-top: 56.25%; border-radius: 10px; overflow: hidden; text-decoration: none; color: #fff; background: linear-gradient(135deg, #6c5b95, #a78bda); }
.video-placeholder .play-icon { position: absolute; top: 38%; left: 50%; transform: translate(-50%,-50%); font-size: 2.4rem; }
.video-placeholder .ph-text { position: absolute; top: 58%; left: 50%; transform: translateX(-50%); font-size: 0.8rem; }
.video-placeholder .ph-sub { position: absolute; top: 70%; left: 50%; transform: translateX(-50%); font-size: 0.68rem; opacity: 0.7; }
.video-broken { color: #e88; font-size: 0.8rem; padding: 8px 0; }

.hidden { display: none; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .side-doodle { display: none; }
  .top-bar { padding: 10px 12px; }
  .board { padding: 12px 12px 60px; }
  .page-body { padding: 14px 12px; }
}
@media (min-width: 641px) {
  .side-doodle { display: flex; }
}
