:root {
  --sakura:#F3DDE4; --mint:#DCEBDD; --moon:#DDE4F0;
  --cream:#F8F3EE; --gold:#D8C6A5; --fog:#7E7674;
  --deep:#5C5655; --white:#FFFDFB; --line:rgba(216,198,165,.22);
  --lpink:#F9EDF0; --lmint:#EDF5EE; --lblue:#EBF0F7; --shadow:0 10px 30px rgba(92,86,85,.08);

  --app-bg:var(--white);
  --card-bg:var(--cream);
  --panel-bg:rgba(248,243,238,.72);
  --floating-bg:rgba(255,253,251,.94);
  --modal-bg:rgba(255,253,251,.98);
  --overlay-bg:rgba(53,47,47,.24);
  --ghost-bg:rgba(255,253,251,.9);
  --note-bg:#FBF7F4;
  --danger-bg:#F6E8E8;
  --danger-text:#9E6767;
  --toast-bg:rgba(92,86,85,.92);
  --theme-btn-bg:rgba(255,253,251,.88);
  --theme-btn-border:rgba(216,198,165,.28);
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Noto Serif SC','Georgia','SimSun',serif;color:var(--fog);background:var(--app-bg);-ms-overflow-style:none;scrollbar-width:none;transition:background .25s ease,color .25s ease}
::-webkit-scrollbar{display:none}
button,input,textarea,select{font:inherit}
button{border:none;background:none;cursor:pointer}
input,textarea,select{outline:none;border:none;background:transparent;color:var(--deep)}
input::placeholder,textarea::placeholder{color:rgba(126,118,116,.38)}
.input-shell input,.input-shell textarea,.input-shell select{display:block;width:100%;max-width:100%;}
.input-shell textarea{box-sizing:border-box;}
.input-shell input,.input-shell textarea,.input-shell select{font-size:12px;line-height:1.7;}
.input-shell input{min-height:40px;padding-top:2px;}
.input-shell textarea{padding-top:2px;}
.input-shell select{
  min-height:32px;
  padding:4px 30px 4px 0;
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  border-radius:0;
  background-color:var(--card-bg);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%237E7674' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 2px center;
  background-size:12px 12px;
}
.input-shell select option{background:var(--card-bg);color:var(--deep);}
.input-shell select::-ms-expand{display:none;}
textarea{resize:vertical;min-height:110px;line-height:1.7}
.app{max-width:430px;margin:0 auto;min-height:100vh;position:relative;padding:0 24px 92px}
@media(min-width:431px){.app,.tab-bar,.fab,.toast-wrap{max-width:720px}}
@media(min-width:821px){.app,.tab-bar,.fab,.toast-wrap{max-width:960px}}
.page{display:none;animation:fadeUp .35s ease both}
.page.active{display:block}
.section{margin-bottom:22px}
.section-label{font-size:10px;letter-spacing:2px;color:var(--gold);margin-bottom:10px;display:flex;align-items:center;gap:6px}
.muted{color:rgba(126,118,116,.55)}
.small{font-size:10px}
.card,.soft-card,.link-row,.layer-box,.calendar-day,.filter-btn,.subfilter-btn,.toolbar-btn,.mini-chip,.quick-btn,.fab,.detail-meta,.input-shell{transition:all .2s ease}
.card{border-radius:14px;padding:16px 18px;background:var(--card-bg);box-shadow:var(--shadow)}
.soft-card{border-radius:14px;padding:14px 16px;background:var(--panel-bg);border:1px solid var(--line)}
.page-top{padding-top:44px;margin-bottom:22px}
.title{font-size:18px;font-weight:400;color:var(--deep);letter-spacing:2px}
.subtitle{font-size:10px;color:rgba(126,118,116,.45);letter-spacing:1px;margin-top:4px}
.divider{width:38px;height:1px;background:linear-gradient(90deg,transparent,rgba(216,198,165,.45),transparent);margin:18px auto 0}
.dot{width:4px;height:4px;border-radius:50%;background:var(--gold)}
.tag,.mini-chip{font-size:9px;color:rgba(126,118,116,.75);background:rgba(221,228,240,.62);padding:2px 7px;border-radius:999px;display:inline-flex;align-items:center;gap:4px}
.layer-tag{font-size:9px;letter-spacing:1px;padding:2px 8px;border-radius:999px;display:inline-block}
.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.toolbar-btn,.quick-btn{padding:7px 12px;border-radius:999px;background:var(--ghost-bg);border:1px solid var(--line);font-size:11px;color:var(--fog)}
.quick-btn.primary,.toolbar-btn.primary{background:linear-gradient(135deg,var(--moon),var(--sakura));color:var(--deep)}
.search-shell{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:10px 14px;border-radius:14px;background:var(--card-bg);border:1px solid var(--line);margin-bottom:14px}
.search-label{font-size:11px;color:var(--gold);letter-spacing:1px;white-space:nowrap}
.search-input.clean{background:transparent;margin:0;padding:0;min-width:0;font-size:12px;color:var(--deep)}
.search-input.clean::placeholder{color:rgba(126,118,116,.28)}
.search-icon{display:inline-flex;align-items:center;justify-content:center;color:rgba(126,118,116,.5);font-size:15px;line-height:1}
.tab-bar{position:fixed;left:50%;bottom:0;transform:translateX(-50%);width:100%;max-width:430px;background:var(--floating-bg);backdrop-filter:blur(16px);border-top:1px solid var(--line);display:flex;justify-content:space-around;padding:8px 0;padding-bottom:max(8px,env(safe-area-inset-bottom));z-index:50}
.tab-btn{display:flex;flex-direction:column;align-items:center;gap:2px;padding:4px 12px}
.tab-btn .icon{font-size:18px;color:var(--gold);opacity:.42}
.tab-btn .label{font-size:10px;letter-spacing:1px;color:var(--gold);opacity:.55}
.tab-btn.active .icon,.tab-btn.active .label{color:var(--fog);opacity:1}
.filter-bar,.subfilter-bar{display:flex;gap:8px;overflow:auto;padding-bottom:4px}
.filter-btn,.subfilter-btn{border-radius:999px;padding:5px 12px;font-size:10px;letter-spacing:1px;white-space:nowrap;border:1px solid var(--line);color:rgba(126,118,116,.55);background:transparent}
.filter-btn.active,.subfilter-btn.active{border-color:transparent}
.search-input{width:100%;border-radius:12px;padding:11px 14px;background:var(--card-bg);font-size:12px;color:var(--fog);margin-bottom:14px}
.mem-card,.bottle,.diary-col{border-radius:14px;padding:16px 18px;position:relative;cursor:pointer;box-shadow:var(--shadow)}
.bottle{margin-bottom:16px}
.mem-card{margin-bottom:12px}
.mem-card .meta,.bottle-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:9px;align-items:flex-start}
.mem-card .title-txt,.diary-col .dtitle{font-size:14px;font-weight:400;color:var(--deep);margin-bottom:6px}
.mem-card .preview,.bottle .preview,.diary-col .dcontent{font-size:12px;line-height:1.75;color:var(--fog);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.mem-card .date,.bottle-date,.archive-stat-label,.archive-note{font-size:9px;color:rgba(126,118,116,.35)}
.mem-card .corner,.bottle .corner{position:absolute;right:16px;bottom:12px;font-size:9px;color:rgba(126,118,116,.3)}
.diary-day{margin-bottom:28px}
.diary-dateline{text-align:center;font-size:11px;color:var(--gold);letter-spacing:2px;margin-bottom:14px;position:relative}
.diary-dateline::before{content:'';position:absolute;top:50%;left:0;right:0;height:1px;background:rgba(216,198,165,.2)}
.diary-dateline span{background:var(--white);padding:0 12px;position:relative;z-index:1}
.diary-cols{display:flex;gap:10px}
.diary-col .author{font-size:9px;color:var(--gold);letter-spacing:1px;margin-bottom:8px}
.diary-empty{font-size:11px;color:rgba(126,118,116,.22);font-style:italic;text-align:center;padding-top:18px}
.bottle.unread{border-left:2px solid #A0B4C8}
.bottle .undot{position:absolute;top:14px;right:14px;width:6px;height:6px;border-radius:50%;background:#A0B4C8}
.fab{position:fixed;right:24px;bottom:82px;width:48px;height:48px;border-radius:50%;background:linear-gradient(135deg,var(--moon),var(--sakura));display:flex;align-items:center;justify-content:center;font-size:19px;color:var(--white);box-shadow:0 8px 22px rgba(221,228,240,.55);z-index:35}
.fab .fab-icon{display:flex;align-items:center;justify-content:center;transform:scaleX(-1);line-height:1}
.fab.hidden{opacity:0;pointer-events:none}
.id-card{background:linear-gradient(160deg,var(--lmint),var(--lblue));border-radius:18px;padding:24px 20px;margin-bottom:18px;text-align:center;box-shadow:var(--shadow)}
.stats-row{display:flex;justify-content:center;gap:18px}
.stat-num{font-size:31px;font-weight:300;color:var(--deep);font-family:Georgia,serif}
.stat-div{width:1px;background:rgba(216,198,165,.2)}
.archive-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:20px}
.layer-box{border-radius:14px;padding:13px 12px;text-align:center;cursor:pointer;border:1px solid rgba(255,255,255,.35)}
.layer-box .lname{font-size:9px;letter-spacing:1px;margin-bottom:6px}
.layer-box .lcount{font-size:22px;font-weight:300;color:var(--deep);font-family:Georgia,serif}
.layer-box .lwords{font-size:9px;color:rgba(126,118,116,.4)}
.link-row{background:var(--card-bg);border-radius:12px;padding:14px 16px;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center;cursor:pointer;border:1px solid var(--line)}
.link-row .arrow{font-size:10px;color:var(--gold)}
.home-hero{text-align:center;margin-bottom:28px;padding-top:44px}
.home-date{font-size:11px;letter-spacing:3px;color:var(--gold);margin-bottom:16px}
.home-count{font-size:56px;font-weight:300;color:var(--fog);line-height:1;margin-bottom:4px;font-family:Georgia,serif;letter-spacing:-2px}
.kv{display:flex;gap:12px;align-items:center}
.kv .accent-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}
.calendar-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.calendar-week{font-size:9px;text-align:center;color:rgba(126,118,116,.35);margin-bottom:6px}
.calendar-day{border-radius:10px;min-height:44px;padding:6px 4px;background:var(--cream);font-size:10px;text-align:center;border:1px solid rgba(255,255,255,.4);display:flex;flex-direction:column;justify-content:space-between;cursor:pointer}
.calendar-day .mood-dot{width:6px;height:6px;border-radius:50%;margin:0 auto}
.health-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.health-card{border-radius:14px;padding:14px;background:var(--lmint);box-shadow:var(--shadow)}
.health-card h4{font-size:12px;color:var(--deep);font-weight:400;margin-bottom:8px}
.collection-list .link-row{margin-bottom:10px}
.empty{font-size:12px;color:rgba(126,118,116,.35);text-align:center;padding:34px 0}
.modal-backdrop{position:fixed;inset:0;background:var(--overlay-bg);backdrop-filter:blur(3px);display:none;align-items:center;justify-content:center;padding:16px;z-index:150}
.modal-backdrop.show{display:flex}
.modal-sheet{width:min(620px,calc(100vw - 32px));max-height:88vh;background:var(--modal-bg);border-radius:22px;padding:18px 18px 22px;box-shadow:0 18px 60px rgba(53,47,47,.14);overflow:auto}
.modal-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}
.modal-title{font-size:17px;color:var(--deep);letter-spacing:1px}
.modal-sub{font-size:10px;color:rgba(126,118,116,.42);margin-top:4px}
.close-btn{width:34px;height:34px;border-radius:50%;background:var(--cream);color:var(--fog)}
.detail-meta{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 14px}
.detail-body{font-size:13px;line-height:1.9;color:var(--fog);white-space:pre-wrap}
.action-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.ghost-btn,.solid-btn,.danger-btn{padding:9px 14px;border-radius:999px;font-size:12px}
.ghost-btn{background:var(--card-bg);color:var(--fog)}
.solid-btn{background:linear-gradient(135deg,var(--moon),var(--sakura));color:var(--deep)}
.danger-btn{background:var(--danger-bg);color:var(--danger-text)}
.form-grid{display:grid;gap:10px}
.input-shell{position:relative;background:var(--card-bg);border-radius:12px;padding:10px 12px;border:1px solid transparent;display:block}
.input-shell:focus-within{border-color:rgba(216,198,165,.35)}
.input-label{font-size:10px;color:var(--gold);letter-spacing:1px;margin-bottom:6px;display:block}
.split{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.checkbox-row{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--fog)}.checkbox-group{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.check-card{display:flex;align-items:center;gap:10px;padding:14px 16px;border-radius:14px;background:var(--cream);border:1px solid rgba(216,198,165,.28);min-height:60px}
.check-card input{width:18px;height:18px;flex:0 0 auto;margin:0}
.check-text{font-size:12px;line-height:1.45;color:var(--fog)}
@media(max-width:380px){.checkbox-group{grid-template-columns:1fr}}
.toast-wrap{position:fixed;left:50%;transform:translateX(-50%);bottom:94px;width:100%;max-width:430px;padding:0 24px;z-index:140;pointer-events:none}
.toast{pointer-events:auto;background:var(--toast-bg);color:#fff;border-radius:14px;padding:12px 14px;display:none;justify-content:space-between;gap:12px;align-items:center;box-shadow:0 10px 30px rgba(53,47,47,.18)}
.toast.show{display:flex}
.toast button{color:#fff;font-size:12px;text-decoration:underline}
.notice{font-size:11px;line-height:1.7;color:rgba(126,118,116,.66);padding:10px 12px;border-radius:12px;background:var(--note-bg)}

.auth-gate{position:fixed;inset:0;background:var(--app-bg);display:none;align-items:center;justify-content:center;padding:24px;z-index:200;}
.auth-gate.show{display:flex;animation:fadeUp .35s ease both;}
.auth-card{width:min(400px,calc(100vw - 32px));background:var(--modal-bg);border-radius:22px;padding:32px 26px 28px;box-shadow:0 18px 60px rgba(53,47,47,.14);border:1px solid var(--line);}
.auth-brand{width:8px;height:8px;border-radius:50%;background:var(--gold);margin:0 auto 18px;animation:breathe 3s ease-in-out infinite;}
.auth-title{font-size:18px;color:var(--deep);letter-spacing:3px;text-align:center;margin-bottom:6px;font-weight:400;}
.auth-sub{font-size:10px;color:rgba(126,118,116,.45);letter-spacing:2px;text-align:center;margin-bottom:26px;}
.auth-form{display:grid;gap:12px;}
.auth-form .input-shell{background:var(--card-bg);}
.auth-form .input-label{color:var(--gold);}
.auth-form input{font-size:13px;color:var(--deep);width:100%;min-height:32px;line-height:1.6;}
.auth-error{font-size:11px;line-height:1.6;color:var(--danger-text);background:var(--danger-bg);padding:9px 12px;border-radius:10px;text-align:center;display:none;}
.auth-error.show{display:block;}
.auth-submit{margin-top:6px;padding:12px;border-radius:999px;background:linear-gradient(135deg,var(--moon),var(--sakura));color:var(--deep);font-size:13px;letter-spacing:2px;border:none;cursor:pointer;font-family:inherit;}
.auth-submit:disabled{opacity:.55;cursor:wait;}
.auth-foot{font-size:10px;color:rgba(126,118,116,.42);letter-spacing:1px;text-align:center;margin-top:18px;}

@keyframes fadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes breathe{0%,100%{opacity:.4}50%{opacity:.8}}

.editor-backdrop{position:fixed;inset:0;background:var(--modal-bg);display:none;z-index:130;overflow:auto}
.editor-backdrop.show{display:block}
.editor-page{width:min(760px,100%);margin:0 auto;min-height:100vh;padding:0 20px 120px}
.editor-header{position:sticky;top:0;z-index:5;display:flex;align-items:flex-start;gap:14px;justify-content:space-between;margin:0 -20px 16px;padding:18px 20px 14px;background:var(--modal-bg);backdrop-filter:blur(10px);border-bottom:1px solid rgba(216,198,165,.14)}
.editor-back{display:inline-flex;align-items:center;justify-content:center;color:var(--fog);font-size:26px;line-height:1;padding:4px 6px;min-width:34px}
.editor-main{display:grid;gap:12px}
.editor-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.editor-grid-top{display:grid;grid-template-columns:1.3fr .9fr;gap:10px;position:relative;z-index:1}
.editor-grid-three{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;position:relative;z-index:1}
.mood-pick{display:flex;flex-wrap:wrap;gap:8px}
.mood-chip{display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;border-radius:999px;border:1px solid var(--line);font-size:11px;color:var(--fog);background:transparent;cursor:pointer}
.mood-chip.active{background:linear-gradient(135deg,var(--moon),var(--sakura));border-color:transparent;color:var(--deep);box-shadow:0 6px 16px rgba(216,198,165,.22);font-weight:600}
.note-box{padding:10px 12px;border-radius:14px;background:var(--note-bg);border:1px solid var(--line);font-size:11px;line-height:1.7;color:rgba(126,118,116,.72);white-space:pre-wrap}
.helper-row{display:flex;gap:8px;flex-wrap:wrap}
.helper-link{font-size:11px;color:var(--fog);padding:7px 10px;border-radius:999px;background:var(--ghost-bg);border:1px solid var(--line)}
.helper-link.active{background:linear-gradient(135deg,var(--moon),var(--sakura));border-color:transparent;color:var(--deep)}
.textarea-compact{min-height:56px}

.theme-toggle{
  position:fixed;
  top:max(14px, calc(env(safe-area-inset-top) + 6px));
  right:max(14px, calc(env(safe-area-inset-right) + 8px));
  width:40px;
  height:40px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--theme-btn-bg);
  border:1px solid var(--theme-btn-border);
  color:var(--fog);
  backdrop-filter:blur(14px);
  box-shadow:0 8px 24px rgba(53,47,47,.08);
  z-index:160;
}
.theme-toggle svg{
  width:19px;
  height:19px;
  stroke:currentColor;
  fill:none;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.theme-toggle:hover{transform:translateY(-1px);}
body.theme-dark{
  --sakura:#3B2E39;
  --mint:#25342F;
  --moon:#2C3341;
  --cream:#16181D;
  --gold:#C9B08B;
  --fog:#B8B0AC;
  --deep:#D6CDC9;
  --white:#0F1115;
  --line:rgba(201,176,139,.18);
  --lpink:#2A232A;
  --lmint:#1A2421;
  --lblue:#1E2530;
  --shadow:0 14px 34px rgba(0,0,0,.26);

  --app-bg:#0F1115;
  --card-bg:#16181D;
  --panel-bg:rgba(28,31,38,.9);
  --floating-bg:rgba(15,17,21,.88);
  --modal-bg:rgba(15,17,21,.96);
  --overlay-bg:rgba(0,0,0,.45);
  --ghost-bg:rgba(25,28,35,.92);
  --note-bg:#1A1D24;
  --danger-bg:#332327;
  --danger-text:#F0B7BF;
  --toast-bg:rgba(14,16,21,.96);
  --theme-btn-bg:rgba(20,23,29,.88);
  --theme-btn-border:rgba(201,176,139,.18);
}
body.theme-dark .tab-bar,
body.theme-dark .editor-header,
body.theme-dark .modal-sheet,
body.theme-dark .editor-backdrop,
body.theme-dark .search-shell,
body.theme-dark .search-input,
body.theme-dark .link-row,
body.theme-dark .input-shell,
body.theme-dark .ghost-btn,
body.theme-dark .toolbar-btn,
body.theme-dark .quick-btn,
body.theme-dark .helper-link,
body.theme-dark .note-box,
body.theme-dark .notice,
body.theme-dark .calendar-day,
body.theme-dark .briefing-card{
  box-shadow:none;
}
body.theme-dark .id-card{background:linear-gradient(160deg,#1B2421,#1C2430);}
body.theme-dark .health-card{background:#1A2421;}
body.theme-dark .bottle.unread{border-left-color:#8AA4C0;}
body.theme-dark .bottle .undot{background:#8AA4C0;}
body.theme-dark .search-input.clean::placeholder{color:rgba(214,205,201,.35);}
body.theme-dark .briefing-card{border-color:rgba(255,255,255,.06);}
body.theme-dark .briefing-label{color:#C9B08B;}
body.theme-dark .briefing-list li{color:#DDD3CE;}
body.theme-dark .mem-card .date,
body.theme-dark .bottle-date,
body.theme-dark .archive-stat-label,
body.theme-dark .archive-note,
body.theme-dark .modal-sub,
body.theme-dark .muted,
body.theme-dark .small{
  color:rgba(214,205,201,.56);
}
body.theme-dark .diary-dateline span{background:var(--app-bg);}
body.theme-dark .close-btn{background:var(--card-bg);}
body.theme-dark .layer-box{background:var(--card-bg) !important;border-color:rgba(201,176,139,.12);}
body.theme-dark .layer-box .lname{color:rgba(201,176,139,.8) !important;}
body.theme-dark .layer-box .lcount{color:var(--fog);}
body.theme-dark .mem-card,
body.theme-dark .bottle,
body.theme-dark .diary-col{background:var(--card-bg) !important;box-shadow:none;}
body.theme-dark .mem-card .title-txt,
body.theme-dark .diary-col .dtitle{color:var(--fog);}
body.theme-dark .layer-tag{background:rgba(255,255,255,.08) !important;color:var(--gold) !important;}
body.theme-dark .mini-chip{background:rgba(255,255,255,.14) !important;}
body.theme-dark .id-card .stat-num{color:var(--fog);}
body.theme-dark .filter-btn.active{background:var(--card-bg) !important;color:var(--gold) !important;}
body.theme-dark .subfilter-btn.active{background:var(--card-bg) !important;color:var(--gold) !important;}
body.theme-dark .soft-card{background:var(--card-bg) !important;}
body.theme-dark .card{box-shadow:0 8px 24px rgba(0,0,0,.32);}
body.theme-dark .card > .mem-card{background:transparent !important;}
body.theme-dark .filter-btn{color:rgba(184,176,172,.55) !important;}
body.theme-dark .subfilter-btn{color:rgba(184,176,172,.55) !important;}
body.theme-dark #subshell .input-shell{background:var(--card-bg);}
body.theme-dark .health-card{background:var(--card-bg) !important;}
body.theme-dark .calendar-day{background:var(--card-bg) !important;}
body.theme-dark .mood-dot{opacity:.8;}
body.theme-dark .empty{color:rgba(184,176,172,.35);}
body.theme-dark .check-card{background:var(--card-bg);border-color:rgba(201,176,139,.12);}
body.theme-dark .import-dropzone:hover,
body.theme-dark .import-dropzone.import-dragover{background:rgba(201,176,139,.08);}
body.theme-dark .ghost-btn{background:rgba(255,255,255,.07);color:rgba(214,205,201,.88);border:1px solid rgba(255,255,255,.15);}
body.theme-dark .ghost-btn:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.24);}
body.theme-dark .ghost-btn:active{background:rgba(255,255,255,.09);}
body.theme-dark input::placeholder,body.theme-dark textarea::placeholder{color:rgba(184,176,172,.35);}

@media(max-width:560px){
  .app{padding:0 20px 96px}
  .split,.editor-grid-top,.editor-grid-three{grid-template-columns:1fr}
  .modal-sheet{width:100%;max-width:100%;max-height:calc(100vh - 32px);border-radius:20px;padding:16px}
  .editor-page{padding:0 16px 120px}
  .editor-header{margin:0 -16px 16px;padding:18px 16px 14px}
}

.briefing-card {
  background: var(--card-bg, #FEFCF8);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(0,0,0,0.04);
}
.briefing-section { margin-bottom: 10px; }
.briefing-section:last-child { margin-bottom: 0; }
.briefing-label {
  font-size: 11px;
  color: #B8A08C;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.briefing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.briefing-list li {
  font-size: 13px;
  color: #6B5E50;
  line-height: 1.6;
  padding-left: 10px;
  position: relative;
}
.briefing-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: #C4A882;
}

.import-dropzone {
  margin-top: 20px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.import-dropzone:hover, .import-dropzone.import-dragover {
  border-color: var(--gold);
  background: rgba(216,198,165,.06);
}
.import-dropzone-icon {
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}
.import-dropzone-hint {
  font-size: 14px;
  color: var(--fog);
}


.link-row-end{display:flex;align-items:center;gap:8px}
.link-count{font-size:10px;color:rgba(126,118,116,.42);padding:4px 8px;border-radius:999px;background:var(--ghost-bg);border:1px solid var(--line)}
.archive-memory-summary{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:14px;background:var(--card-bg);border:1px solid var(--line);font-size:12px;color:var(--fog)}
.archive-memory-summary strong{font-size:24px;font-weight:300;color:var(--deep);font-family:Georgia,serif}
.archive-memory-card{cursor:pointer}
body.theme-dark .link-count,
body.theme-dark .archive-memory-summary{box-shadow:none}

/* dark mode: fix mini-chip / tag text contrast */
body.theme-dark .mini-chip,
body.theme-dark .tag{color:rgba(214,205,201,.92) !important;background:rgba(255,255,255,.14) !important}

/* debug section */
.dbg-section{margin-top:14px;border-radius:12px;border:1px solid var(--line);overflow:hidden}
.dbg-summary{list-style:none;padding:9px 14px;font-size:10px;letter-spacing:2px;color:var(--gold);cursor:pointer;user-select:none;display:flex;align-items:center;gap:6px;background:transparent}
.dbg-summary::-webkit-details-marker{display:none}
.dbg-summary::before{content:'▸';font-size:9px;display:inline-block;transition:transform .2s ease}
details[open].dbg-section .dbg-summary::before{transform:rotate(90deg)}
.dbg-grid{display:grid;grid-template-columns:max-content 1fr;gap:6px 12px;padding:10px 14px 12px;border-top:1px solid var(--line)}
.dbg-key{font-size:9px;letter-spacing:.5px;color:rgba(126,118,116,.5);font-family:Georgia,serif;align-self:center;white-space:nowrap}
.dbg-val-cell{display:flex;align-items:center}
.dbg-badge{font-size:9px;padding:2px 8px;border-radius:999px;display:inline-flex;align-items:center;letter-spacing:.3px}
.dbg-yes{background:rgba(143,184,154,.2);color:#5A8C6A}
.dbg-no{background:rgba(126,118,116,.1);color:rgba(126,118,116,.65)}
.dbg-na{font-size:10px;color:rgba(126,118,116,.32);font-style:italic}
.dbg-txt{font-size:10px;color:var(--fog)}

/* debug section: dark mode */
body.theme-dark .dbg-section{border-color:rgba(201,176,139,.12)}
body.theme-dark .dbg-grid{border-top-color:rgba(201,176,139,.12)}
body.theme-dark .dbg-key{color:rgba(184,176,172,.38)}
body.theme-dark .dbg-yes{background:rgba(143,184,154,.13);color:#8FCA9A}
body.theme-dark .dbg-no{background:rgba(255,255,255,.06);color:rgba(184,176,172,.6)}
body.theme-dark .dbg-na{color:rgba(184,176,172,.32)}
body.theme-dark .dbg-txt{color:var(--fog)}

/* param section in memory form */
.param-toggle{width:100%;background:var(--card-bg);border:1px solid transparent;border-radius:12px;padding:10px 12px;text-align:left;cursor:pointer;font-size:10px;font-weight:600;letter-spacing:1px;color:var(--gold);display:flex;align-items:center;justify-content:space-between;transition:border-color .2s}
.param-toggle:hover{border-color:rgba(216,198,165,.25)}
.param-arrow{transition:transform .2s ease;font-size:11px;opacity:.7}
.param-toggle-open .param-arrow{transform:rotate(180deg)}
.param-body{padding:8px 0 4px;flex-direction:column;gap:10px;display:none}
.param-body.param-open{display:flex}
.param-body>:first-child{margin-top:2px}
.slider-grid{display:flex;flex-direction:column;gap:4px}
.slider-row{display:flex;align-items:center;gap:8px}
.slider-row .input-label{width:68px;min-width:68px;margin:0;line-height:1.8}
.slider-row input[type=range]{flex:1;min-width:0;accent-color:var(--gold);cursor:pointer;height:18px}
.slider-val{font-size:11px;color:var(--fog);width:30px;text-align:right;flex-shrink:0;font-variant-numeric:tabular-nums}
.check-row{display:flex;gap:16px;flex-wrap:wrap;padding:4px 0}
.check-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--deep);cursor:pointer;user-select:none}
.check-item input[type=checkbox]{accent-color:var(--gold);width:14px;height:14px;cursor:pointer;flex-shrink:0}
.input-helper{display:block;font-size:10px;color:var(--fog);margin-top:5px;line-height:1.5;letter-spacing:.3px}

/* ring comments */
.ring-comment{padding:10px 0;border-top:1px solid var(--line)}
.ring-comment-body{font-size:13px;line-height:1.8;color:var(--deep);white-space:pre-wrap}
.ring-comment-meta{font-size:11px;color:var(--fog);margin-top:4px;display:flex;align-items:center;gap:8px}
.ring-delete-btn{background:none;border:none;color:var(--fog);cursor:pointer;font-size:15px;padding:0 2px;line-height:1;margin-left:auto;opacity:.5}
.ring-delete-btn:hover{color:#C75C5C;opacity:1}
.ring-input-row{margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
.ring-input-footer{display:flex;gap:8px;align-items:center;margin-top:8px}
.ring-author-sel{font-size:12px;padding:6px 8px;border-radius:8px;border:1px solid var(--line);background:var(--card-bg);color:var(--deep);flex-shrink:0}
