:root { --ink: #0a1038; --accent: #4f46e5; --line: #e2e6f0; --soft: #f4f6fb; --mute: #64708f; }
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #c5cbe0 transparent; }
html, body, #app { height: 100%; margin: 0; }
body { font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--soft); overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input, textarea { width: 100%; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
label { display: block; font-weight: 600; font-size: .86rem; margin-top: .9rem; }
label input { margin-top: .3rem; font-weight: 400; }
.btn { padding: .6rem 1rem; border-radius: 10px; font-weight: 600; background: var(--ink); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { color: #be123c; }
.err { color: #be123c; min-height: 1.3em; margin: .6rem 0 0; font-size: .9rem; }

.login { position: relative; min-height: 100%; height: 100dvh; overflow: auto; display: grid; place-items: center; padding: 20px 16px; background: linear-gradient(150deg, #0a1038, #1a1a5e 55%, #0b2a4a); }
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.sky i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(70px); opacity: .5; animation: drift 18s ease-in-out infinite alternate; }
.sky i:nth-child(1) { background: #4f46e5; top: -30vmax; left: -20vmax; } .sky i:nth-child(2) { background: #0ea5e9; bottom: -35vmax; right: -20vmax; animation-duration: 23s; } .sky i:nth-child(3) { background: #9333ea; top: 20%; left: 55%; width: 34vmax; height: 34vmax; opacity: .35; animation-duration: 28s; }
.sky svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
@keyframes drift { to { transform: translate(8vmax, 5vmax) scale(1.12); } }
.login form { position: relative; width: min(400px, 100%); margin: auto; background: rgb(255 255 255 / .94); backdrop-filter: blur(16px); border-radius: 24px; padding: clamp(22px, 6vw, 34px); box-shadow: 0 30px 90px rgb(0 0 0 / .45); animation: up .5s cubic-bezier(.22, 1, .36, 1); }
@keyframes up { from { opacity: 0; transform: translateY(18px); } }
.login img { height: 36px; } .login h1 { margin: 14px 0 0; font-size: 1.6rem; } .login .btn { width: 100%; margin-top: 1.1rem; padding: .8rem; background: linear-gradient(90deg, #4f46e5, #0a1038); }
.sub { color: var(--mute); margin: .3rem 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.pw { position: relative; display: block; } .pw input { padding-right: 46px; } .pw button { position: absolute; right: 2px; bottom: 2px; width: 42px; height: 42px; }
.opts { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: .9rem; font-size: .9rem; } .opts button { color: var(--accent); font-weight: 600; padding: 8px 0; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; cursor: pointer; } .check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.code { letter-spacing: .4em; text-align: center; font-size: 1.3rem !important; font-weight: 700; }
.qr { width: min(220px, 70vw); margin: 0 auto; } .qr svg { width: 100%; height: auto; display: block; } .sheet h3 { margin: 18px 0 0; } .sheet a.btn { text-align: center; text-decoration: none; }

.top { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--ink); color: #fff; }
.top img { height: 24px; } .top b { margin-right: auto; white-space: nowrap; }
.top input { max-width: 460px; height: 38px; border: 0; background: rgb(255 255 255 / .14); color: #fff; margin: 0 auto; }
.top input::placeholder { color: #c7cbea; }
.icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.icon:hover { background: rgb(127 136 176 / .18); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #818cf8, #38bdf8); color: var(--ink); font-weight: 700; flex: none; }
.main { height: calc(100dvh - 56px); display: grid; grid-template-columns: 220px 360px minmax(0, 1fr); }
.side { padding: 12px; overflow: auto; background: var(--soft); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side .btn { margin-bottom: 10px; background: var(--accent); }
.side button.f { display: flex; justify-content: space-between; text-align: left; padding: .55rem .8rem; border-radius: 10px; }
.side button.f:hover { background: #e9ecf6; } .side button.f.on { background: #e0e4fb; font-weight: 700; }
.side small { color: var(--mute); margin-top: auto; padding: 10px 8px; overflow-wrap: anywhere; }
.list { background: #fff; border-right: 1px solid var(--line); overflow: auto; }
.list h2 { position: sticky; top: 0; z-index: 1; background: #fff; margin: 0; padding: 14px 16px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
.row { width: 100%; display: flex; gap: 10px; text-align: left; padding: 11px 14px; border-bottom: 1px solid #eff1f7; border-left: 3px solid transparent; }
.row:hover { background: #f8f9fd; } .row.on { background: #eef0ff; border-left-color: var(--accent); }
.row .t { min-width: 0; flex: 1; } .row .l { display: flex; justify-content: space-between; gap: 8px; }
.row .l span:first-child, .row p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row time { color: var(--mute); font-size: .78rem; flex: none; } .row p { margin: 1px 0 0; font-size: .88rem; } .row p.s { color: var(--mute); }
.row.un .l span:first-child, .row.un p:not(.s) { font-weight: 700; } .row.un time { color: var(--accent); font-weight: 700; }
.empty { padding: 60px 20px; text-align: center; color: var(--mute); }
.more { width: 100%; padding: 14px; color: var(--accent); font-weight: 600; }
.read { background: #fff; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.read .bar { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.read .bar .btn { padding: .45rem .8rem; white-space: nowrap; }
.read header { padding: 16px 20px 10px; flex: none; } .read h1 { font-size: 1.25rem; margin: 0 0 12px; overflow-wrap: anywhere; }
.who { display: flex; gap: 12px; } .who div:last-child { min-width: 0; overflow-wrap: anywhere; } .who small { color: var(--mute); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.files a { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .7rem; text-decoration: none; color: inherit; font-size: .86rem; max-width: 100%; overflow-wrap: anywhere; }
.note { background: #fff8e6; border-radius: 10px; padding: .4rem .8rem; margin-top: 12px; font-size: .86rem; } .note button { color: var(--accent); font-weight: 600; }
.read iframe { flex: 1; width: 100%; border: 0; min-height: 0; background: #fff; }
.only { display: none; }

.over { position: fixed; inset: 0; z-index: 20; background: rgb(10 16 56 / .4); display: flex; justify-content: flex-end; animation: fade .2s; }
.sheet { width: min(640px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column; padding: 18px; gap: 10px; overflow: auto; animation: slide .3s cubic-bezier(.22, 1, .36, 1); }
.sheet .head { display: flex; justify-content: space-between; align-items: center; } .sheet h2 { margin: 0; font-size: 1.15rem; }
.sheet textarea { flex: 1; min-height: 220px; resize: none; } .sheet .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.box { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); } .box div { flex: 1; min-width: 0; overflow-wrap: anywhere; } .box small { color: var(--mute); }
#toast { position: fixed; bottom: 22px; left: 50%; translate: -50% 0; z-index: 40; background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; max-width: 92vw; } #toast:empty { display: none; }
@keyframes fade { from { opacity: 0; } } @keyframes slide { from { transform: translateX(100%); } }

@media (max-width: 1100px) { .main { grid-template-columns: 190px 310px minmax(0, 1fr); } }
@media (max-width: 820px) {
  .main { display: block; position: relative; } .only { display: grid; } .top b { display: none; }
  .list, .read { position: absolute; inset: 0; border: 0; } .read { transform: translateX(100%); transition: transform .28s cubic-bezier(.22, 1, .36, 1); visibility: hidden; z-index: 2; }
  .reading .read { transform: none; visibility: visible; }
  .side { position: fixed; z-index: 15; inset: 0 auto 0 0; width: min(290px, 84vw); transform: translateX(-105%); transition: transform .28s cubic-bezier(.22, 1, .36, 1); visibility: hidden; box-shadow: 0 0 60px rgb(10 16 56 / .35); }
  .menu .side { transform: none; visibility: visible; } .menu::after { content: ""; position: fixed; inset: 0; background: rgb(10 16 56 / .4); z-index: 14; }
  .fab { position: absolute; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 1; width: 58px; height: 58px; border-radius: 18px; background: var(--accent); color: #fff; font-size: 1.5rem; box-shadow: 0 10px 30px rgb(79 70 229 / .45); place-items: center; }
  .sheet { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .fly { display: none; } * { animation: none !important; transition: none !important; } }
