:root {
    --bg: #f7f4ec;        
    --card: rgba(255, 254, 250, 0.85); 
    --card-solid: #fffefa;
    --ink: #2c2416;       
    --ink2: #80725e;
    --gold: #d4ae55;      
    --gold-d: #a88235; 
    --gold-g: #f4e9d0; 
    --red: #9e3232; 
    --red-l: #c44747;
    --border: rgba(214, 195, 158, 0.5); 
    
    --r-lg: 24px;   
    --r-md: 16px;   
    --r-sm: 12px;   

    --spring: cubic-bezier(0.34, 1.6, 0.64, 1); 
    --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
    
    --sab: env(safe-area-inset-bottom, 0px); --ui-scale: 1; 
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); overflow-x: hidden; padding-bottom: calc(90px + var(--sab)); -webkit-tap-highlight-color: transparent; -webkit-overflow-scrolling: touch; background-image: radial-gradient(ellipse at 50% 0%, rgba(212,174,85,0.06) 0%, transparent 70%); min-height: 100dvh; zoom: var(--ui-scale); }

.glass-blur { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.glass-panel { background: var(--card); border: 1px solid var(--border); box-shadow: 0 8px 32px rgba(44, 36, 22, 0.04), inset 0 1px 0 rgba(255,255,255,0.8); }

.spring-press { transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.3s; will-change: transform; cursor: pointer; }
.spring-press:active { transform: scale(0.92) !important; transition-duration: 0.1s !important; filter: brightness(0.95); }
.spring-hover:active { transform: scale(1.2) rotate(10deg); transition: transform 0.3s var(--spring); }
.spring-in { animation: springIn 0.6s var(--spring) both; }
@keyframes springIn { 0% { opacity:0; transform:translateY(20px) scale(0.95); } 100% { opacity:1; transform:translateY(0) scale(1); } }
@keyframes bounce { from{transform:translateY(0);} to{transform:translateY(-10px);} }

/* ==== 修复：输入框告别弹跳，仅轻微放大，保留拖拽 ==== */
.spring-focus { 
    width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-sm); 
    background: rgba(255,255,255,0.7); font-family: inherit; font-size: 14px; color: var(--ink); outline: none; 
    transition: all 0.25s ease-out; /* 极其平滑的过渡，不用弹簧 */
    resize: both; overflow: auto; max-width: 100%; min-height: 44px; 
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.02);
    -webkit-appearance: none;
}
.spring-focus:focus { 
    border-color: var(--gold); background: #fff; 
    box-shadow: 0 0 0 3px rgba(212,174,85,0.2), inset 0 1px 2px rgba(0,0,0,0.01); 
    transform: scale(1.01); /* 仅轻微放大，绝对不乱跳 */
    z-index: 10;
}

.img-press { transition: transform 0.3s var(--ease); cursor: pointer; }
.img-press:active { transform: scale(1.02) !important; }

.fab-mixer { position: fixed; right: 20px; bottom: calc(85px + var(--sab)); width: 58px; height: 58px; background: linear-gradient(135deg, var(--gold-d), var(--gold)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 6px 24px rgba(168,130,53,0.5), inset 0 -3px 6px rgba(0,0,0,0.15); z-index: 400; border: 2px solid var(--gold-g); color: white; }

.header { text-align: center; padding: 24px 16px 12px; position: relative;}
.gold-line { height: 1px; width: 50%; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.header-icon { font-size: 38px; margin: 10px 0 6px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)); display:inline-block;}
.subtitle { font-size: 13px; color: var(--ink2); letter-spacing: 4px; margin: 4px 0 12px; }
.btn-tutorial { background: rgba(212,174,85,0.1); border: 1px solid var(--gold); border-radius: 20px; color: var(--gold-d); padding: 6px 14px; font-size: 12px; font-weight: bold; display: inline-flex; align-items: center; justify-content: center; font-family: inherit;}
.url-btn { position: absolute; top: 6px; right: 6px; z-index: 10; background: rgba(44,36,22,0.65); color: #fff; border-radius: 8px; padding: 4px 8px; font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.25); backdrop-filter: blur(4px); display:flex; align-items:center; justify-content:center; border: 1px solid rgba(255,255,255,0.2);}
.url-btn:active { background: var(--gold); transform: scale(0.9); }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(68px + var(--sab)); padding-bottom: var(--sab); background: rgba(255,254,250,0.9); border-top: 1px solid var(--border); display: flex; z-index: 500; box-shadow: 0 -4px 32px rgba(44,36,22,0.08); }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: none; background: none; font-family: inherit; font-size: 12px; color: var(--ink2); transition: color 0.3s; }
.nav-btn .ni { font-size: 24px; display: block; transition: transform 0.5s var(--spring); }
.nav-btn.active { color: var(--red); font-weight: bold; }
.nav-btn.active .ni { transform: scale(1.25) translateY(-2px); }

.main { padding: 0 16px; max-width: 640px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: tabFadeIn 0.4s var(--ease) both; }
@keyframes tabFadeIn { 0% { opacity: 0; transform: translateY(15px); } 100% { opacity: 1; transform: translateY(0); } }

.select-box { cursor: pointer; padding: 10px 14px; background: url('data:image/svg+xml;utf8,<svg fill="%23a88235" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 10px center; background-size: 20px; background-color: rgba(255,255,255,0.7); padding-right: 36px; min-height: 44px; resize: none;}

.panel { border-radius: var(--r-lg); padding: 24px 20px; }
.sec-title { text-align: center; font-size: 18px; font-weight: normal; letter-spacing: 4px; margin-bottom: 24px; color: var(--ink); }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; color: var(--ink2); margin-bottom: 10px; letter-spacing: 1px; font-weight: bold;}
.upload-label { display: block; font-size: 14px; color: var(--ink2); margin-bottom: 12px; font-weight: bold;}

.upload-row { display: flex; gap: 12px; margin-bottom: 24px; }
.ubox { flex: 1; position: relative; border: 2px dashed var(--gold-d); border-radius: var(--r-md); aspect-ratio: 1; overflow: hidden; background: rgba(244,233,208,0.3); transition: all 0.3s var(--spring); }
.ubox:active { border-color: var(--gold); background: rgba(244,233,208,0.6); transform: scale(0.95);}
.ubox input[type="file"] { position: absolute; inset: 0; opacity: 0; z-index: 2; width: 100%; height: 100%; cursor: pointer; }
.ubox-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 4px; }
.ubox-inner span { font-size: 28px; color: var(--gold); }
.ubox-inner small { font-size: 13px; color: var(--ink2); }
.ubox-inner img { width: 100%; height: 100%; object-fit: cover; animation: springIn 0.5s var(--spring); }

.toggle-row { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; border-radius: var(--r-md);}
.toggle-row label { font-size: 14px; color: var(--ink); margin: 0; font-weight: bold; }
.useless-tip { font-size:12px; color:var(--ink2); font-weight:normal; font-style:italic;}
.switch { position: relative; display: inline-block; width: 52px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(214,195,158,0.5); transition: .4s var(--ease); border-radius: 30px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);}
.slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 4px; bottom: 4px; background-color: white; transition: .4s var(--spring); border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--gold); border: 1px solid var(--gold-d); }
input:checked + .slider:before { transform: translateX(22px); }

/* ==== 修复：防挤压多图库结构，图片绝对固定，文本区紧凑 ==== */
.dynamic-img-container { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.g-img-field { display: flex; gap: 14px; padding: 14px; align-items: flex-start; background: var(--card); border-radius: var(--r-md); border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.02); overflow: hidden;}
.g-img-field .ubox { flex: 0 0 100px !important; height: 100px !important; flex-shrink: 0 !important; } /* 绝对不被压缩 */
.g-img-info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; justify-content: center;}

.sheet-btns-col { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 10px;}
.btn-gold { display: block; width: 100%; padding: 18px; border: none; border-radius: var(--r-md); background: linear-gradient(135deg, var(--gold-d), var(--gold)); color: #fff; font-family: inherit; font-size: 18px; font-weight: bold; letter-spacing: 4px; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.15), 0 6px 20px rgba(212,174,85,0.4); text-shadow: 0 2px 4px rgba(0,0,0,0.2);}
.btn-red { display: block; width: 100%; padding: 18px; border: none; border-radius: var(--r-md); background: linear-gradient(135deg, var(--red), var(--red-l)); color: #fff; font-family: inherit; font-size: 18px; font-weight: bold; letter-spacing: 4px; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.15), 0 6px 20px rgba(158,50,50,0.4); text-shadow: 0 2px 4px rgba(0,0,0,0.2);}
.btn-secondary { display: block; width: 100%; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-sm); background: rgba(255,255,255,0.7); color: var(--ink2); font-family: inherit; font-size: 16px; font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.02); text-align: center;}
.btn-dashed { display: block; width: 100%; padding: 16px; border: 2px dashed var(--gold); border-radius: var(--r-md); background: rgba(244,233,208,0.2); color: var(--gold-d); font-family: inherit; font-size: 16px; font-weight: bold; }

.audio-console { display: flex; align-items: center; gap: 12px; margin-top: 14px; background: rgba(255,255,255,0.5); padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--border); box-shadow: inset 0 2px 8px rgba(0,0,0,0.02); }
.audio-console .btn-gold { padding: 10px 16px; width: auto; font-size: 14px; letter-spacing: 1px; border-radius: var(--r-sm); box-shadow: 0 4px 10px rgba(212,174,85,0.3); }
.vol-control { flex: 1; display: flex; align-items: center; gap: 8px; background: rgba(214,195,158,0.2); padding: 8px 12px; border-radius: 30px; border: 1px solid rgba(214,195,158,0.4);}
.vol-slider { flex: 1; height: 6px; background: rgba(214,195,158,0.4); border-radius: 4px; outline: none; -webkit-appearance: none; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); }
.vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; background: #fff; border: 4px solid var(--gold); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2); transition: transform 0.2s var(--spring); }
.vol-slider::-webkit-slider-thumb:active { transform: scale(1.3); background: var(--gold); }
#volIcon { font-size: 16px; width: 20px; text-align: center; }
#volText { font-size: 13px; color: var(--ink2); min-width: 38px; text-align: right; font-weight: bold; font-family: monospace;}

.toolbar { border-radius: var(--r-lg); padding: 20px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 16px; }
.tool-row { display: flex; justify-content: space-between; align-items: center; }
.count { font-size: 15px; color: var(--ink2); font-weight: bold; background:rgba(255,255,255,0.5); padding:6px 14px; border-radius:20px; border:1px solid var(--border);}
.scale-control { border-top: 1px dashed var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.scale-control label { font-size: 13px; color: var(--ink2); font-weight: bold; }
.scale-control input[type="range"] { width: 100%; height: 8px; background: rgba(214,195,158,0.4); border-radius: 4px; outline: none; -webkit-appearance: none; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);}
.scale-control input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; background: var(--gold); border-radius: 50%; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: transform 0.4s var(--spring); }
.scale-control input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.3); }

.api-settings { margin-bottom: 16px; }
.api-settings summary { padding: 16px; font-size: 15px; font-weight: bold; color: var(--ink); cursor: pointer; outline: none; user-select: none; border-radius:var(--r-sm);}
.api-fields { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }

.card-list { display: flex; flex-direction: column; gap: 20px; }
.artist-card { border-radius: var(--r-lg); animation: listStagger 0.6s var(--ease) both; }
@keyframes listStagger { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }
.artist-card::before { content: ''; display: block; height: 4px; background: linear-gradient(90deg, transparent 5%, var(--gold) 50%, transparent 95%); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.card-body { padding: 20px; }
.card-name { font-size: 22px; color: var(--red); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; font-weight:bold; }
.card-name::before { content: '◈'; color: var(--gold); font-size: 14px; }

/* 修复画师Tag区撑爆：增加最大高度和滚动条 */
.card-tag { background: rgba(255,255,255,0.7); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 16px; font-size: 16px; line-height: 1.6; margin-bottom: 16px; word-break: break-all; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); max-height: 100px; overflow-y: auto; scrollbar-width: thin;}
.card-memo { font-size: 15px; color: var(--ink2); line-height: 1.5; padding-left: 14px; border-left: 3px solid var(--gold-g); margin-bottom: 20px; }
.card-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.card-btns button { flex: 1; padding: 14px 6px; border-radius: var(--r-sm); font-size: 14px; font-family: inherit; font-weight: bold; border: 1px solid var(--border); min-width: 64px; display:flex; align-items:center; justify-content:center; gap:4px; box-shadow: 0 2px 6px rgba(0,0,0,0.02);}
.card-btns button:active { box-shadow: none; }

.b-pin { background: #fff; color: var(--ink); }
.b-pin.active-pin { background: var(--gold-g); border-color: var(--gold) !important; color: var(--ink); }
.b-fav { background: #fff; color: var(--ink2); }
.b-fav.active-fav { background: var(--gold-g); border-color: var(--gold) !important; color: var(--ink); }

.b-copy { background: #fff; color: var(--ink); }
.b-mix  { background: var(--gold-g); border-color: var(--gold) !important; color: var(--ink); }
.b-edit { background: #f2f7f2; border-color: #a4c9a4 !important; color: #325432; }
.b-del  { background: #fcf4f4; border-color: #e5b0b0 !important; color: var(--red); }
.card-imgs { display: flex; border-top: 1px solid var(--border); background: rgba(244,233,208,0.15); border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden;}
.img-cell { flex: 1; padding: 14px; text-align: center; border-right: 1px solid var(--border); }
.img-cell:last-child { border-right: none; }
.img-cell span { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 8px; font-weight:bold;}
.img-cell img { width: 100%; height: 80px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }
.img-empty { width: 100%; height: 80px; border-radius: var(--r-sm); border: 1px dashed var(--gold-d); display: flex; align-items: center; justify-content: center; font-size: 20px; color: rgba(212,174,85,0.6); background: rgba(255,255,255,0.5); }

.gallery-scroll { display: flex; overflow-x: auto; gap: 16px; padding: 20px; border-top: 1px solid var(--border); background: rgba(244,233,208,0.15); scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.gallery-scroll::-webkit-scrollbar { display: none; }
.g-item { flex: 0 0 88%; scroll-snap-align: center; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; background: var(--card-solid); box-shadow: 0 6px 16px rgba(44,36,22,0.06); display: flex; flex-direction: column;}
.g-item img { width: 100%; height: 240px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); margin-bottom: 8px; flex-shrink: 0;} /* 绝对防挤压 */

/* ==== 修复：详情区严格限高防撑爆，单行截断 ==== */
.g-item-details { 
    background: var(--bg); padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); 
    display: flex; flex-direction: column; gap: 6px; 
    max-height: 90px; overflow-y: auto; scrollbar-width: thin;
}
.g-item-row { display: flex; align-items: center; gap: 6px; height: 22px; min-height: 22px; flex-shrink: 0; overflow: hidden;}
.g-item-row .lbl { font-size: 11px; font-weight: bold; color: var(--gold-d); flex: none; width: 18px;}
/* 核心：文本强制单行截断，永远不会把容器撑高 */
.g-item-row .val { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; flex: 1; max-width: 120px; font-weight: bold;}
.g-item-row button { background: var(--card-solid); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; color: var(--ink); font-size: 11px; font-weight: bold; flex: none; white-space: nowrap;}
.g-item-row button.mixer-btn { background: var(--gold); color: #fff; border:none;}

.mixer-tools { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.mixer-tools .tag-count { font-size: 13px; color: var(--ink2); font-weight: bold; background: rgba(255,255,255,0.5); padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); }
.mixer-tools .btn-dedup { font-size: 13px; color: var(--gold-d); font-weight: bold; background: rgba(212,174,85,0.1); padding: 4px 12px; border-radius: 20px; border: 1px solid var(--gold); cursor: pointer; }
.mixer-tools .btn-dedup:active { transform: scale(0.92); }

.backup-row { display: flex; gap: 16px; margin-top: 30px; }

.gacha-main { text-align: center; }
.gacha-desc { font-size: 15px; color: var(--ink2); margin-bottom: 32px; }
.qian-container { position: relative; width: 130px; height: 170px; margin: 0 auto 36px; }
.qian-glow { position: absolute; width: 180px; height: 180px; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(212,174,85,0.2) 0%, transparent 70%); animation: glow 3s ease-in-out infinite; }
@keyframes glow { 50% { transform: translate(-50%,-50%) scale(1.2); opacity: 1; } }
.qian-tong { position: relative; width: 100%; height: 100%; z-index: 2; transform-origin: bottom center; }
.tong-body { width: 90px; height: 120px; margin: 0 auto; background: linear-gradient(180deg, var(--gold), var(--gold-d)); border-radius: 14px 14px 24px 24px; position: relative; border: 1px solid var(--gold-g); overflow: visible; box-shadow: inset 0 0 16px rgba(0,0,0,0.2), 0 8px 24px rgba(168,130,53,0.4); }
.tong-stick { position: absolute; width: 8px; height: 60px; border-radius: 4px 4px 0 0; bottom: 70%; transition: transform 0.4s var(--ease); }
#stick1 { left: 24px; background: linear-gradient(180deg, #c44747, #9e3232); transform: rotate(-10deg); }
#stick2 { left: 41px; background: linear-gradient(180deg, #e0b45c, #a88235); transform: rotate(0deg); }
#stick3 { left: 58px; background: linear-gradient(180deg, #6c9e6c, #3c6e3c); transform: rotate(8deg); }
.tong-base { width: 110px; height: 20px; margin: -2px auto 0; background: linear-gradient(180deg, var(--gold-d), #8a6b28); border-radius: 0 0 14px 14px; box-shadow: 0 6px 12px rgba(0,0,0,0.15);}
.qian-tong.shaking { animation: tongShake 0.8s var(--spring); }
.qian-tong.shaking .tong-stick { animation: stickJump 0.8s var(--spring); }
@keyframes tongShake { 15% { transform: rotate3d(0,0,1,-20deg); } 30% { transform: rotate3d(0,0,1,20deg); } 45% { transform: rotate3d(0,0,1,-15deg); } 60% { transform: rotate3d(0,0,1,15deg); } 75% { transform: rotate3d(0,0,1,-8deg); } 100% { transform: rotate3d(0,0,1,0deg); } }
@keyframes stickJump { 25% { transform: translate3d(0,-30px,0); } 50% { transform: translate3d(0,16px,0); } 75% { transform: translate3d(0,-20px,0); } }
.btn-gacha { background: linear-gradient(135deg, var(--red), var(--red-l)); color: #fff; border: none; padding: 20px 54px; border-radius: 50px; font-family: inherit; font-size: 20px; font-weight: bold; letter-spacing: 5px; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), 0 8px 28px rgba(158,50,50,0.4); }
.gacha-result { margin-top: 40px; perspective: 1000px; }
.qian-paper { width: 300px; height: 200px; margin: 0 auto; animation: paperFly 0.7s var(--spring) both; }
@keyframes paperFly { 0% { opacity: 0; transform: translate3d(0,-150px,0) rotateX(60deg) scale(0.3); } 100% { opacity: 1; transform: translate3d(0,0,0) rotateX(0) scale(1); } }
.qian-paper-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.8s var(--spring); }
.qian-paper.flipped .qian-paper-inner { transform: rotateY(180deg); }
.qp-front, .qp-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qp-front { background: linear-gradient(145deg, var(--gold-d), var(--gold)); color: #fff; font-size: 60px; font-weight: bold; border: 3px solid var(--gold-g); box-shadow: inset 0 0 24px rgba(0,0,0,0.15);}
.qp-back { background: var(--card-solid); border: 3px solid var(--gold); transform: rotateY(180deg); padding: 24px; box-shadow: 0 12px 40px rgba(44,36,22,0.2); }
.qp-seal { background: var(--red); color: #fff; font-size: 13px; padding: 6px 20px; border-radius: 20px; margin-bottom: 14px; letter-spacing: 3px; font-weight:bold;}
.qp-back h3 { color: var(--red); font-size: 24px; margin-bottom: 12px; font-weight:bold;}
.qp-tag { font-size: 15px; max-height: 48px; overflow: hidden; margin-bottom: 10px; line-height:1.6;}
.qp-memo { font-size: 14px; color: var(--ink2); }
.particles { position: absolute; top: 0; left: 50%; width: 0; height: 0; pointer-events: none; }
.particle { position: absolute; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; animation: pFly 1.2s var(--ease) forwards; box-shadow: 0 0 10px var(--gold);}
@keyframes pFly { 0% { opacity: 1; transform: translate3d(0,0,0) scale(1); } 100% { opacity: 0; transform: translate3d(var(--px), var(--py), 0) scale(0); } }

.lightbox { position: fixed; inset: 0; background: rgba(20,16,10,0.85); display: flex; align-items: center; justify-content: center; z-index: 900; padding: 16px; opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);}
.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: var(--r-md); transform: scale(0.7); transition: transform 0.5s var(--spring); box-shadow: 0 16px 64px rgba(0,0,0,0.6);}
.lightbox.show img { transform: scale(1); }

.modal-mask { position: fixed; inset: 0; background: rgba(44,36,22,0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 800; animation: fadeMask 0.4s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);}
@keyframes fadeMask { from{opacity:0;} to{opacity:1;} }
.modal-sheet { background: linear-gradient(180deg, rgba(255,254,250,0.95) 0%, rgba(247,244,236,0.98) 100%); width: 100%; max-width: 520px; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 24px calc(32px + var(--sab)); max-height: 90vh; overflow-y: auto; will-change: transform; box-shadow: 0 -8px 40px rgba(44,36,22,0.15); border-top: 1px solid rgba(255,255,255,0.9);}
.sheet-in { animation: sheetUp 0.6s var(--spring) both; }
@keyframes sheetUp { 0% { transform: translate3d(0,100%,0); } 100% { transform: translate3d(0,0,0); } }
.sheet-handle { width: 48px; height: 6px; border-radius: 3px; background: rgba(214,195,158,0.6); margin: 0 auto 24px; cursor: pointer; transition: background 0.3s;}
.sheet-handle:active { background: var(--gold); }
.modal-title { font-size: 20px; text-align: center; margin-bottom: 28px; color: var(--ink); letter-spacing: 4px; font-weight:bold;}

.toast { position: fixed; bottom: calc(100px + var(--sab)); left: 50%; z-index: 2000; background: rgba(44,36,22,0.95); color: var(--gold-g); padding: 16px 32px; border-radius: 50px; font-size: 16px; font-weight: bold; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate3d(-50%, 30px, 0) scale(0.85); transition: all 0.5s var(--spring); box-shadow: 0 10px 32px rgba(0,0,0,0.3); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);}
.toast.show { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }
.hidden { display: none !important; }
.empty-state { text-align: center; padding: 80px 0; color: var(--ink2); animation: springIn 0.6s var(--spring);}
.empty-state .ei { font-size: 60px; margin-bottom: 24px; opacity: 0.9; animation: bounce 2s infinite alternate var(--spring);}
.empty-state p { letter-spacing: 3px; font-size: 16px; font-weight:bold;}

@media (min-width: 768px) { body { padding-bottom: 0; } .bottom-nav { position: sticky; top: 0; height: 64px; max-width: 640px; margin: 0 auto; border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 0; border-top:none; border-bottom: 1px solid var(--border);} .nav-btn { flex-direction: row; gap: 8px; font-size:14px;} .main { max-width: 760px; padding: 32px; } .card-list { grid-template-columns: 1fr; display: grid; gap: 24px; } .modal-mask { align-items: center; } .modal-sheet { border-radius: var(--r-lg); max-width: 480px; padding: 32px 36px;} .toast { bottom: 48px; } .fab-mixer { right: calc(50% - 380px); bottom: 48px; width:68px; height:68px; font-size:28px;} .g-item-row .val { max-width: 200px; } }
