
:root{
  color-scheme:light;
  --bg:#f2f5fb;--surface:#fff;--aside:#fafbff;--paper:#fff;--text:#18243c;--muted:#53617b;
  --line:#dce3ef;--accent:#294dbc;--accent-dark:#1d3c9d;--accent-light:#e8edff;--warning:#8d480b;
  --note:#ffe5a8;--match:#d8e2ff;font-family:"Pretendard","Malgun Gothic","Apple SD Gothic Neo",system-ui,sans-serif;
}
:root[data-theme="dark"]{
  color-scheme:dark;--bg:#131a29;--surface:#1b2437;--aside:#182032;--paper:#181f2e;--text:#e9eefb;
  --muted:#acb8cf;--line:#343f56;--accent:#a9bfff;--accent-dark:#c0d0ff;--accent-light:#2b3961;
  --note:#594d25;--match:#324d8a;--warning:#ffbe81;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--text);font-size:1rem;line-height:1.55}
button,input,select,textarea{font:inherit}
button{cursor:pointer;color:inherit}
button:disabled{cursor:default;opacity:.56}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.paper:focus-visible{
  outline:3px solid var(--accent);outline-offset:3px
}
a{color:var(--accent)}
.bar{height:68px;display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:0 5vw;background:var(--surface);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:12px;color:var(--text);font-weight:750;text-decoration:none;font-size:1.24rem}
.brand small{margin-left:5px;color:var(--muted);font-size:.83rem;font-weight:550}
.mark{display:grid;place-content:center;gap:3px;width:34px;height:34px;border-radius:9px;background:var(--accent)}
.mark i{display:block;width:16px;height:2px;background:var(--surface);border-radius:1px}
.mark i:last-child{width:10px}
.bar-actions,.side-actions,.reader-actions,.reader-bottom,.dialog-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.primary,.secondary,.quiet{min-height:38px;border-radius:7px;padding:7px 12px;border:1px solid transparent;font-size:.9rem;font-weight:650}
.primary{background:var(--accent);color:var(--surface)}
.primary:hover{background:var(--accent-dark)}
.secondary{background:var(--surface);border-color:var(--line)}
.quiet{background:transparent;color:var(--muted)}
.secondary:hover,.quiet:hover,.side-link:hover,.list-action:hover{background:var(--accent-light);color:var(--text)}
.layout{max-width:1500px;margin:auto;display:grid;grid-template-columns:minmax(230px,275px) 1fr;min-height:calc(100dvh - 68px)}
.sidebar{padding:26px 20px;background:var(--aside);border-right:1px solid var(--line)}
.side-actions button{flex:1;white-space:nowrap}
.side-group{margin-top:1.75rem}
.side-group h2{font-size:.86rem;color:var(--muted);margin:0 0 .62rem;font-weight:700}
.side-group p{color:var(--muted);font-size:.86rem;margin:0}
.resume{width:100%;background:var(--accent-light);color:var(--text);border:0;text-align:left;padding:10px 12px;border-radius:8px;display:grid;gap:3px;margin-bottom:8px}
.resume strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.resume small,.fine,.items small{color:var(--muted);font-size:.84rem}
.items{list-style:none;margin:0;padding:0}
.folder-files{max-height:12em;overflow:auto}
.side-link,.list-action{border:0;background:transparent;text-align:left;padding:7px 8px;border-radius:6px;width:100%;font-size:.9rem;display:block;overflow-wrap:anywhere}
.items .list-action span,.items .list-action small{display:block}
.item-row{display:flex;align-items:center;justify-content:space-between}
.item-row .list-action{flex:1;min-width:0}
footer{display:flex;gap:10px;flex-wrap:wrap;margin-top:2rem;font-size:.77rem}
footer a{color:var(--muted);text-decoration:none}
footer a:hover{text-decoration:underline}
.workspace{padding:clamp(14px,3.4vw,44px);min-width:0}
.welcome{display:grid;justify-items:center;align-content:center;min-height:min(560px,67dvh);text-align:center;border:1px dashed var(--line);border-radius:13px;background:var(--surface);padding:25px}
.welcome.drag{border-color:var(--accent);background:var(--accent-light)}
.welcome h1{font-size:clamp(1.4rem,3vw,2.1rem);margin:.9rem 0 0;letter-spacing:-.055em}
.welcome p{margin:.25rem 0 1rem;color:var(--muted)}
.welcome p.fine{margin:.85rem 0 0}
.paper-icon{display:grid;place-content:center;gap:6px;width:57px;height:71px;border:1px solid var(--line);border-radius:9px;color:var(--accent);background:var(--accent-light);transform:rotate(-7deg)}
.paper-icon i{width:31px;height:2px;border-radius:3px;background:currentColor}
.paper-icon i:last-child{width:20px}
.reading{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:12px;overflow:hidden}
.tabs{display:flex;overflow-x:auto;gap:5px;padding:8px 12px;border-bottom:1px solid var(--line)}
.tab{display:flex;flex:0 0 auto;max-width:16rem;align-items:center;border-radius:7px;background:var(--bg)}
.tab.active{background:var(--accent-light)}
.tab button{max-width:13rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reader-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid var(--line)}
.reader-toolbar h1{margin:0;font-size:1.19rem;overflow-wrap:anywhere}
.paper{height:clamp(290px,61dvh,760px);overflow:auto;background:var(--paper);font-size:var(--font-size,1.08rem);line-height:1.75;padding:20px 6%}
.line{display:block;white-space:pre-wrap;overflow-wrap:anywhere;min-height:1.75em}
.line.focus-line{background:var(--accent-light)}
.line mark{color:inherit;background:var(--note);border-radius:2px}
.line mark.match{background:var(--match)}
.reader-bottom{justify-content:space-between;padding:8px 13px;border-top:1px solid var(--line)}
.notice{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 30px);background:var(--text);color:var(--surface);border-radius:8px;padding:9px 16px;margin:0;z-index:10}
dialog{width:min(calc(100vw - 30px),540px);color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:18px 20px;max-height:84dvh}
dialog::backdrop{background:#121c36a8}
.dialog-head{display:flex;justify-content:space-between;align-items:center;margin:0 0 10px;gap:12px}
.dialog-head h2{margin:0;font-size:1.22rem}
dialog p{color:var(--muted);margin:.5rem 0 1rem}
.dialog-actions{margin:12px 0}
dialog label{display:block;font-size:.9rem;font-weight:650;margin:.75rem 0}
dialog input:not([type="range"]),dialog select,dialog textarea{display:block;width:100%;margin-top:.3rem;border:1px solid var(--line);background:var(--surface);color:var(--text);padding:8px;border-radius:6px}
dialog input[type="range"]{display:block;width:100%}
dialog .results{max-height:36dvh;overflow:auto;padding:2px}
dialog .results .item-row{border-bottom:1px solid var(--line)}
dialog .results small{display:block;color:var(--muted);overflow-wrap:anywhere}
@media(max-width:720px){
  .bar{height:58px;padding:0 14px}
  .layout{grid-template-columns:1fr}
  .workspace{grid-row:1;padding:12px}
  .sidebar{border:0;border-top:1px solid var(--line);padding:15px 14px 25px}
  .sidebar .side-group{margin-top:1rem}
  .welcome{min-height:44dvh}
  .reader-toolbar{align-items:flex-start;flex-direction:column;padding:10px}
  .reader-actions{gap:4px}
  .paper{height:49dvh;padding:13px}
  .reader-bottom{padding:7px;gap:3px}
  .reader-bottom button{padding:6px;min-height:34px;font-size:.82rem}
}

