:root{
  --m3-bg:#18120f;--m3-card:#241e1b;--m3-sheet:#2b241f;--m3-text:#ece0da;
  --m3-muted:#d6c3b7;--m3-outline:#52443b;--m3-primary:#ffb784;
  --m3-on-primary:#4f2500;--m3-selection:#623f25;--m3-on-selection:#ffdcc6;
}
.m3-button,.m3-text-button,.m3-icon,.m3-chip{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;
  font-size:14px;font-weight:500;line-height:20px;
}
.m3-button{padding:8px 18px;border-radius:100px;background:var(--m3-primary);color:var(--m3-on-primary)}
.m3-button:disabled{background:var(--m3-card);color:var(--m3-muted);cursor:default;opacity:.68}
.m3-text-button{padding:4px 12px;color:var(--m3-primary);border-radius:100px}
.m3-icon{width:48px;flex:none;padding:0;border-radius:100px;color:inherit;font-size:23px}
.m3-icon:hover,.m3-text-button:hover{background:#ece0da12}
.m3-chip{padding:4px 12px;border:1px solid var(--m3-outline);border-radius:8px;color:var(--m3-muted)}
.m3-chip[aria-current],.m3-chip[aria-pressed=true]{background:var(--m3-selection);color:var(--m3-on-selection);border-color:transparent}
.m3-chip[aria-current]::before,.m3-chip[aria-pressed=true]::before{content:'✓'}
.m3-bar{background:var(--m3-bg);padding-top:env(safe-area-inset-top);color:var(--m3-text)}
.m3-bar-inner{display:flex;align-items:center;min-height:64px;width:min(1120px,100% - 8px);margin:auto;gap:4px}
.m3-bar h1,.m3-bar-title{font-size:22px;line-height:28px;font-weight:400;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}
.m3-bar-main{padding-inline:16px}
.m3-bar h1:last-child{padding-right:8px}
.m3-copy{font-size:14px;line-height:20px;color:var(--m3-muted)}
.m3-state{display:grid;align-content:center;justify-items:center;gap:12px;min-height:220px;padding:24px 16px;text-align:center}
.m3-state h2{font-size:20px;font-weight:400}
.m3-state-icon{color:var(--m3-primary);font-size:22px}
.m3-card{background:var(--m3-card);border-radius:16px;padding:12px}
.m3-vip{display:grid;gap:7px;background:#713700;color:var(--m3-on-selection);border-radius:16px;padding:16px}
.m3-vip strong{font-weight:500}
.m3-cover{display:block;overflow:hidden;background:var(--m3-card);border-radius:8px;flex:none}
.m3-cover img{height:100%}
.m3-dialog{background:var(--m3-sheet);color:var(--m3-text);border:0}
.m3-dialog::backdrop{background:#0009}
.m3-dialog .dialog-head{margin-bottom:8px}
.m3-dialog .dialog-head h2{font-size:20px;font-weight:400}
.m3-dialog .m3-button{width:100%}
.m3-dialog .m3-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.m3-dialog-actions .m3-button{width:auto}
.m3-dialog-handle{display:block;width:32px;height:4px;border-radius:8px;background:#9f8d83;margin:0 auto 8px}
dialog.m3-confirm{inset:0;margin:auto;width:min(360px,calc(100% - 48px));border-radius:24px;padding:20px}
.m3-confirm p{margin-top:10px}
.m3-loading{display:grid;gap:12px}
.m3-skeleton{min-height:76px;border-radius:12px;background:linear-gradient(105deg,var(--m3-card) 30%,var(--m3-sheet) 50%,var(--m3-card) 70%);background-size:220% 100%;animation:m3-shimmer 1.6s linear infinite}
@keyframes m3-shimmer{to{background-position:-220% 0}}
@media(prefers-reduced-motion:reduce){.m3-skeleton{animation:none}}
@media(max-width:767px){
  body{--bg:var(--m3-bg);--panel:var(--m3-card);--surface:var(--m3-sheet);--line:var(--m3-outline);--ink:var(--m3-text);--muted:var(--m3-muted);--accent:var(--m3-primary);--accent-ink:var(--m3-on-primary);font-family:Roboto,"PingFang SC","Noto Sans SC",system-ui,sans-serif;font-size:14px}
  h1,h2,h3,.brand,.meta,.text-button,.primary,.secondary,.poster-card h3,.resume strong{font-weight:500}
  .m3-mobile-bar{position:sticky;top:0;z-index:6}
  .poster-card h3,.find-card h3,.rank-copy h2,.search-drama h3{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:500}
  .poster-image,.find-card img,.rank-card img,.search-drama img,.m3-cover,.home-highlight,.discover-art{background-color:var(--m3-card)}
  img.m3-image-ready{animation:m3-image-in .25s ease-out}
  @keyframes m3-image-in{from{opacity:0}to{opacity:1}}
  @media(prefers-reduced-motion:reduce){img.m3-image-ready{animation:none}}
  .primary{min-height:44px;border-radius:100px}
  .bottom-nav a,.bottom-nav button,.text-button,.icon-button{min-height:44px}
  .m3-sheet{padding:12px 16px calc(16px + env(safe-area-inset-bottom));border-radius:24px 24px 0 0;overscroll-behavior:contain}
}
.m3-poster-grid .catalog-muted{display:none}
@media(max-width:767px){
  .m3-poster-grid .catalog-muted{display:block}
  .catalog-page .find-card h3,.catalog-page .rank-copy h2,.search-page .search-drama h3{
    display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:500;
  }
}
@media(min-width:768px){
  .desktop-only .top{display:block}
}
