.cc { --bg: linear-gradient(145deg,#845ef7,#5c3fc4); --fg: #fff; --key: rgba(255,255,255,.14); --op: rgba(255,255,255,.26); --eq: rgba(255,255,255,.92); --eqfg: #4c2fb0; --line: rgba(255,255,255,.25);
  max-width: 400px; margin: 0 auto; padding: 14px 14px 16px; border-radius: 26px; background: var(--bg); color: var(--fg); box-shadow: 0 14px 40px rgba(0,0,0,.22); user-select: none; -webkit-user-select: none; touch-action: manipulation; position: relative; }
.cc { font-family: -apple-system, 'Segoe UI', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif; }
.cc button { font: inherit; color: inherit; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cc [hidden] { display: none !important; }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cc-tabs { display: flex; gap: 2px; background: var(--key); border-radius: 999px; padding: 3px; }
.cc-tabs button { background: none; padding: 6px 13px; border-radius: 999px; font-size: 14px; opacity: .8; }
.cc-tabs button.on { background: var(--op); opacity: 1; font-weight: 700; }
.cc-tools { display: flex; gap: 8px; align-items: center; }
.cc-tools button { width: 36px; height: 36px; border-radius: 50%; background: var(--key); font-size: 17px; line-height: 1; }
.cc-dot { background: conic-gradient(#f03e3e,#f59f00,#82c91e,#12b886,#228be6,#7950f2,#e64980,#f03e3e) !important; border: 2px solid var(--fg) !important; }
/* 螢幕 */
.cc-screen { padding: 10px 6px 12px; text-align: right; min-height: 112px; display: flex; flex-direction: column; justify-content: flex-end; }
.cc-expr { font-size: 17px; opacity: .72; min-height: 24px; overflow: hidden; white-space: nowrap; direction: rtl; text-overflow: ellipsis; unicode-bidi: plaintext; }
.cc-res { background: none !important; text-align: right; font-size: 58px; font-weight: 300; line-height: 1.1; padding: 0; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; letter-spacing: -.5px; width: 100%; user-select: text; -webkit-user-select: text; }
.cc-res.bad { font-size: 28px; }
/* 按鍵 */
.cc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cc-keys .k { aspect-ratio: 1 / .82; border-radius: 22px; background: var(--key); font-size: 25px; font-weight: 400; transition: transform .08s, filter .15s; backdrop-filter: blur(2px); }
.cc-keys .k.op { background: var(--op); font-size: 28px; }
.cc-keys .k.fn { font-size: 20px; }
.cc-keys .k.eq { background: var(--eq); color: var(--eqfg); font-weight: 700; font-size: 30px; }
.cc-keys .k:active { transform: scale(.93); filter: brightness(1.25); }
/* 歷史 */
.cc-hist { background: var(--key); border-radius: 18px; padding: 8px 12px; margin: 0 0 10px; max-height: 190px; overflow: auto; }
.cc-hist-h { display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: .9; }
.cc-hist-h button { background: none; text-decoration: underline; font-size: 13px; }
.cc-hist ul { list-style: none; margin: 4px 0 0; padding: 0; }
.cc-hist li { padding: 7px 2px; border-top: 1px solid var(--line); text-align: right; cursor: pointer; font-size: 14px; }
.cc-hist li small { display: block; opacity: .7; font-size: 12.5px; }
.cc-hist li b { font-size: 18px; font-weight: 600; }
.cc-hist .none { opacity: .7; text-align: center; cursor: default; border: 0; }
/* 調色 */
.cc-pal { position: absolute; left: 14px; right: 14px; top: 64px; z-index: 20; max-height: calc(100% - 78px); overflow: auto; background: linear-gradient(var(--key), var(--key)), var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.35); border-radius: 20px; padding: 14px; display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
.cc-ringwrap { position: relative; width: 150px; height: 150px; }
.cc-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, hsl(0,var(--rs,80%),var(--rl,55%)), hsl(60,var(--rs,80%),var(--rl,55%)), hsl(120,var(--rs,80%),var(--rl,55%)), hsl(180,var(--rs,80%),var(--rl,55%)), hsl(240,var(--rs,80%),var(--rl,55%)), hsl(300,var(--rs,80%),var(--rl,55%)), hsl(360,var(--rs,80%),var(--rl,55%))); -webkit-mask: radial-gradient(circle, transparent 0 52%, #000 53%); mask: radial-gradient(circle, transparent 0 52%, #000 53%); touch-action: none; cursor: pointer; }
.cc-handle { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45); pointer-events: none; }
.cc-swatch { position: absolute; inset: 28%; border-radius: 50%; box-shadow: 0 0 0 3px var(--line); }
.cc-sliders { display: grid; gap: 8px; font-size: 13px; }
.cc-sliders label { display: grid; grid-template-columns: 4.8em 1fr; align-items: center; gap: 6px; }
.cc-sliders input[type=range] { width: 100%; accent-color: var(--fg); }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chips button { background: var(--key); padding: 5px 11px; border-radius: 999px; font-size: 13px; }
.cc-chips button.on { background: var(--op); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--fg); }
.cc-sliders .cc-chk { display: flex; grid-template-columns: none; gap: 8px; }
.cc-presets { grid-column: 1 / -1; display: flex; flex-wrap: nowrap; gap: 8px; justify-content: center; }
.cc-presets button { flex: none; width: 31px; height: 31px; border-radius: 50%; box-shadow: 0 0 0 2px var(--line); }
.cc-presets button.on { box-shadow: 0 0 0 3px var(--fg); }
@media (max-width: 380px) { .cc-pal { grid-template-columns: 1fr; justify-items: center; } .cc-ringwrap { width: 140px; height: 140px; } .cc-sliders { width: 100%; } }
/* 分帳、折扣 */
.cc-form { display: grid; gap: 12px; padding: 4px 2px 2px; }
.cc-form label { display: grid; gap: 5px; font-size: 14px; }
.cc-form input[type=text] { width: 100%; box-sizing: border-box; border: 0; border-radius: 14px; padding: 12px 14px; font-size: 22px; background: var(--key); color: inherit; outline: none; font-variant-numeric: tabular-nums; }
.cc-form input::placeholder { color: inherit; opacity: .5; font-size: 15px; }
.cc-form input:focus { box-shadow: 0 0 0 2px var(--fg); }
.cc-lab { font-size: 14px; }
.cc-step { display: flex; gap: 8px; }
.cc-step button { width: 54px; border-radius: 14px; background: var(--op); font-size: 24px; }
.cc-step input { text-align: center; }
.cc-chips input { width: 96px !important; padding: 5px 11px !important; font-size: 14px !important; border-radius: 999px !important; }
.cc-chk { display: flex !important; align-items: center; gap: 8px; }
.cc-out { background: var(--key); border-radius: 18px; padding: 14px 16px; display: grid; gap: 6px; min-height: 60px; }
.cc-out .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.cc-out .row b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cc-out .big { font-size: 15px; }
.cc-out .big b { font-size: 34px; font-weight: 600; }
.cc-out .sub { font-size: 13px; opacity: .75; }
.cc-toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(20,20,30,.88); color: #fff; padding: 7px 16px; border-radius: 999px; font-size: 14px; pointer-events: none; }

/* ───── App 裡：撐滿整個畫面、不能上下拉動 ───── */
.is-app, .is-app body { overflow: hidden; overscroll-behavior: none; height: 100%; }
.is-app #tl-root { padding: 0 !important; margin: 0 !important; max-width: none !important; }
.is-app .tl-head, .is-app #tl-install-tip, .is-app #tl-root > .tl-note { display: none !important; }
.is-app .cc { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; top: var(--cc-top, 50px); max-width: none; margin: 0; border-radius: 0; box-shadow: none; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); }
.is-app .cc-top { flex: none; }
.is-app #cc-calc { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.is-app #cc-calc .cc-screen { flex: 1 1 auto; min-height: 90px; }
.is-app #cc-calc .cc-hist { flex: none; max-height: 34%; }
.is-app .cc-keys { flex: 0 0 56%; grid-template-rows: repeat(5, 1fr); }
.is-app .cc-keys .k { aspect-ratio: auto; height: 100%; min-height: 0; }
.is-app .cc-form { flex: 1; overflow: auto; align-content: start; }
