﻿html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
.page { height: 100vh; display: flex; flex-direction: column; }
.top { height: 56px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--side); border-bottom: 1px solid var(--line); }
.top .left, .top .right { display: flex; align-items: center; gap: 14px; }
.top a { color: var(--muted); text-decoration: none; font-size: 14px; }
.top a:hover { color: var(--text); }
.top img { height: 16px; filter: invert(1); }
.top strong { font-size: 15px; font-weight: 600; }
select, input { font: inherit; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none; }
select option { background: #1f1f22; color: #ececf1; }
.btn { font: inherit; font-size: 14px; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer; }
.btn:hover { background: var(--hover); }
.btn.primary { background: #ececf1; border-color: #ececf1; color: #0e0e10; font-weight: 600; }
.btn.primary:hover { background: #fff; }
.ws { flex: 1; display: flex; min-height: 0; }
.files { width: 240px; flex-shrink: 0; background: var(--side); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.files .new { background: #ececf1; color: #0e0e10; border: 0; border-radius: 10px; padding: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.files .label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 6px 10px 0; }
#flist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.file { padding: 8px 10px; border-radius: 8px; color: #cfcfd8; font-size: 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.file:hover { background: var(--hover); color: var(--text); }
.file.on { background: var(--panel); color: var(--text); box-shadow: inset 2px 0 0 #3ddc97; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { font-size: 10px; font-weight: 600; letter-spacing: 0.6px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.editor-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.toolbar { height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
#fname { width: 320px; max-width: 40%; background: transparent; border-color: transparent; font-weight: 600; font-size: 15px; }
#fname:hover { border-color: var(--line); }
#fname:focus { background: var(--panel); border-color: #4a4a57; }
#status { margin-left: auto; font-size: 12px; color: var(--muted); }
#editor { flex: 1; width: 100%; resize: none; border: 0; outline: none; background: #0b0b0d; color: #e4e4ea; font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 14px; line-height: 1.7; padding: 20px 24px; tab-size: 2; }
.preview { width: 44%; flex-shrink: 0; background: var(--side); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.preview-head { height: 56px; padding: 0 16px; display: flex; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.preview iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.preview .note { flex: 1; padding: 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.gate { margin: auto; max-width: 440px; padding: 40px 32px; background: var(--side); border: 1px solid var(--line); border-radius: 16px; text-align: center; }
.gate h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin: 0 0 10px; }
.gate p { color: var(--muted); }
.gate ul { text-align: left; color: var(--muted); margin: 20px auto 28px; max-width: 320px; padding-left: 18px; line-height: 1.8; }
.hidden { display: none !important; }
@media (max-width: 900px) { .preview { display: none; } .files { width: 180px; } }
