:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --line: #e5e7eb;
  --line-strong: #d5d9df;
  --text: #20242a;
  --muted: #7b8492;
  --accent: #20242a;
  --green: #23a06b;
  --red: #e84a5f;
  --blue: #2f80ed;
  --shadow: 0 12px 34px rgba(28, 35, 48, .08);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* Login */
.login-page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 12% 12%, rgba(47,128,237,.10), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(232,74,95,.10), transparent 30%),
    #f7f8fa;
}
.login-shell { width: min(1050px, 100%); display: grid; grid-template-columns: 1.25fr .85fr; gap: 24px; align-items: stretch; }
.login-brand, .login-card { border: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(12px); border-radius: 24px; box-shadow: var(--shadow); }
.login-brand { padding: 58px; position: relative; overflow: hidden; }
.login-brand::after { content:""; width: 320px; height: 320px; border-radius: 50%; border: 1px dashed rgba(32,36,42,.15); position:absolute; right:-120px; bottom:-160px; }
.brand-mark { width:64px; height:64px; display:grid; place-items:center; border-radius:18px; color:#fff; background:#20242a; font:700 24px var(--mono); box-shadow:0 12px 25px rgba(32,36,42,.20); }
.eyebrow { margin:28px 0 8px; font:700 11px var(--mono); letter-spacing:.18em; color:var(--muted); }
.login-brand h1 { margin:0; font-size: clamp(42px, 6vw, 76px); letter-spacing:-.06em; }
.brand-copy { max-width: 430px; margin: 18px 0 34px; font-size:17px; line-height:1.8; color:#5c6572; }
.brand-points { display:flex; flex-wrap:wrap; gap:10px; }
.brand-points span { padding:9px 13px; border:1px solid var(--line); border-radius:999px; background:#fff; color:#4a5360; font-size:13px; }
.login-card { padding:42px; display:flex; flex-direction:column; justify-content:center; }
.login-card-head { display:flex; align-items:center; gap:9px; color:#596270; font-size:13px; margin-bottom:30px; }
.status-dot { width:8px; height:8px; border-radius:50%; background:var(--green); box-shadow:0 0 0 5px rgba(35,160,107,.10); }
.login-card h2 { margin:0 0 8px; font-size:28px; }
.login-card form { display:grid; gap:16px; margin-top:28px; }
.login-card label { display:grid; gap:8px; font-size:13px; color:#555e6b; }
.login-card input { width:100%; border:1px solid var(--line-strong); background:#fff; border-radius:11px; padding:13px 14px; outline:none; transition:.2s; }
.login-card input:focus { border-color:#20242a; box-shadow:0 0 0 4px rgba(32,36,42,.07); }
.primary-btn { border:0; border-radius:11px; padding:14px 18px; color:#fff; background:#20242a; font-weight:700; transition:.2s; }
.primary-btn:hover { transform:translateY(-1px); box-shadow:0 10px 22px rgba(32,36,42,.18); }
.primary-btn:disabled { opacity:.65; cursor:wait; transform:none; }
.login-error { min-height:18px; margin:0; color:#d43b50; font-size:13px; }
.login-tip { margin:26px 0 0; color:var(--muted); font-size:12px; line-height:1.6; }

/* App shell */
.app-page { overflow:hidden; background:#eef0f3; }
.app-shell { height:100dvh; display:flex; flex-direction:column; }
.topbar { height:58px; flex:0 0 58px; display:flex; align-items:center; gap:16px; padding:0 16px; background:#fff; border-bottom:1px solid var(--line); z-index:20; }
.logo { display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:-.03em; white-space:nowrap; }
.logo-icon { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; background:#20242a; color:#fff; font:700 12px var(--mono); }
.top-nav { display:flex; gap:4px; margin-left:12px; padding:4px; background:#f1f3f5; border-radius:11px; }
.top-nav button { border:0; background:transparent; color:#69717e; border-radius:8px; padding:8px 14px; font-size:13px; }
.top-nav button.active { background:#fff; color:#20242a; box-shadow:0 2px 8px rgba(31,38,48,.09); font-weight:700; }
.topbar-spacer { flex:1; }
.presence { display:flex; align-items:center; gap:7px; color:#596270; font-size:12px; }
.presence-avatars { display:flex; }
.mini-avatar { width:28px; height:28px; border-radius:50%; display:grid; place-items:center; border:2px solid #fff; color:#fff; font:700 10px var(--font); margin-left:-7px; }
.mini-avatar:first-child { margin-left:0; }
.mini-avatar.offline { background:#c5cad2 !important; }
.icon-btn { width:36px; height:36px; border:1px solid var(--line); background:#fff; border-radius:10px; display:grid; place-items:center; color:#555e6b; }
.icon-btn:hover { background:#f7f8fa; }
.user-pill { display:flex; align-items:center; gap:8px; padding:5px 9px 5px 5px; border:1px solid var(--line); border-radius:999px; font-size:12px; }
.avatar { width:27px; height:27px; border-radius:50%; display:grid; place-items:center; color:#fff; font-size:10px; font-weight:800; }

/* Workspace */
.view { flex:1; min-height:0; }
.workspace { display:grid; grid-template-columns:280px minmax(360px,1fr) 360px; gap:10px; padding:10px; height:100%; min-height:0; }
.panel { min-width:0; min-height:0; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 4px 18px rgba(30,37,48,.04); overflow:hidden; display:flex; flex-direction:column; }
.panel-head { height:50px; flex:0 0 50px; padding:0 13px; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--line); }
.panel-title { font-size:13px; font-weight:800; letter-spacing:-.01em; }
.panel-sub { color:var(--muted); font-size:11px; }
.panel-head .spacer { flex:1; }
.small-btn { border:1px solid var(--line); background:#fff; border-radius:8px; padding:7px 10px; font-size:12px; color:#4f5865; white-space:nowrap; }
.small-btn:hover { background:#f7f8fa; }
.small-btn.primary { background:#20242a; color:#fff; border-color:#20242a; }
.small-btn.danger { color:#cb3048; }

.file-tools { padding:10px; border-bottom:1px solid var(--line); display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.file-list { flex:1; overflow:auto; padding:7px; }
.file-item { display:flex; align-items:center; gap:9px; padding:9px 8px; border-radius:9px; cursor:pointer; border:1px solid transparent; }
.file-item:hover { background:#f5f7f9; }
.file-item.active { background:#f0f3f7; border-color:#dfe5ec; }
.file-icon { flex:0 0 30px; height:30px; border-radius:8px; display:grid; place-items:center; background:#eef1f5; color:#58616e; font:700 9px var(--mono); }
.file-info { flex:1; min-width:0; }
.file-name { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:600; }
.file-meta { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.file-actions { display:flex; gap:2px; opacity:0; }
.file-item:hover .file-actions { opacity:1; }
.file-actions button { width:25px; height:25px; padding:0; border:0; background:transparent; border-radius:6px; color:#7a8390; }
.file-actions button:hover { background:#e9edf2; color:#20242a; }
.empty-state { padding:38px 20px; text-align:center; color:var(--muted); font-size:12px; line-height:1.7; }

.editor-panel { position:relative; }
.editor-head { height:50px; flex:0 0 50px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:10px; padding:0 12px; }
.editor-file { min-width:0; flex:1; }
.editor-file strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.editor-file span { display:block; color:var(--muted); font-size:10px; margin-top:3px; }
.edit-status { display:flex; align-items:center; gap:6px; padding:6px 9px; border-radius:999px; background:#eef8f3; color:#228158; font-size:11px; white-space:nowrap; }
.edit-status.locked { background:#fff0f2; color:#c92d46; }
.editor-tabs { height:36px; flex:0 0 36px; display:flex; align-items:center; gap:4px; padding:0 8px; border-bottom:1px solid var(--line); background:#fafbfc; }
.editor-tabs button { border:0; background:transparent; color:#7b8491; font-size:11px; padding:6px 10px; border-radius:7px; }
.editor-tabs button.active { background:#fff; color:#20242a; box-shadow:0 1px 5px rgba(30,37,48,.12); font-weight:700; }
.editor-main { flex:1; min-height:0; position:relative; background:#fbfcfe; }
.editor-scroll { position:absolute; inset:0; display:grid; grid-template-columns:52px minmax(0,1fr); overflow:hidden; }
.line-numbers { margin:0; padding:16px 8px 30px 4px; text-align:right; color:#a5adb8; background:#f6f8fa; border-right:1px solid #ededf0; font:13px/1.62 var(--mono); overflow:hidden; user-select:none; }
.code-stage { position:relative; min-width:0; overflow:hidden; }
.code-highlight, #codeArea { margin:0; border:0; width:100%; height:100%; padding:16px 18px 30px; font:13px/1.62 var(--mono); white-space:pre; tab-size:4; overflow:auto; }
.code-highlight { position:absolute; inset:0; color:#2d333b; pointer-events:none; background:#fbfcfe; }
#codeArea { position:absolute; inset:0; resize:none; outline:none; color:transparent; caret-color:#161c24; background:transparent; z-index:2; }
#codeArea::selection { background:rgba(47,128,237,.22); }
#codeArea:disabled { cursor:not-allowed; }
.code-highlight code { display:block; min-height:100%; }
.line { display:block; min-height:1.62em; }
.line.flash-red { background:linear-gradient(90deg, rgba(232,74,95,.19), rgba(232,74,95,.06)); box-shadow:inset 3px 0 0 var(--red); }
.line.flash-blue { background:linear-gradient(90deg, rgba(47,128,237,.19), rgba(47,128,237,.06)); box-shadow:inset 3px 0 0 var(--blue); }
.tok-comment { color:#8a929c; font-style:italic; }
.tok-string { color:#b45309; }
.tok-keyword { color:#7c3aed; font-weight:600; }
.tok-number { color:#0f766e; }
.tok-function { color:#2563eb; }
.tok-tag { color:#dc2626; }
.tok-attr { color:#0f766e; }
.tok-heading { color:#1d4ed8; font-weight:700; }
.editor-footer { flex:0 0 35px; height:35px; border-top:1px solid var(--line); display:flex; align-items:center; gap:10px; padding:0 11px; background:#fff; color:var(--muted); font:11px var(--mono); }
.editor-footer .spacer { flex:1; }
.lint-status { display:flex; align-items:center; gap:5px; }
.lint-status.error { color:#d13c51; }
.lint-status.ok { color:#228158; }
.problems { flex:0 0 auto; max-height:130px; overflow:auto; border-top:1px solid var(--line); background:#fffafa; }
.problem { display:flex; gap:8px; padding:8px 12px; border-bottom:1px solid #f2e8e9; font-size:11px; color:#7d3e48; cursor:pointer; }
.problem:hover { background:#fff4f5; }
.problem code { color:#b5243e; font-weight:700; }
.autocomplete { position:absolute; z-index:30; display:none; width:240px; max-height:220px; overflow:auto; background:#fff; border:1px solid var(--line-strong); border-radius:10px; box-shadow:0 15px 40px rgba(25,32,43,.18); padding:5px; }
.autocomplete.open { display:block; }
.ac-item { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 9px; border-radius:7px; font:12px var(--mono); cursor:pointer; }
.ac-item.active, .ac-item:hover { background:#edf3fb; }
.ac-kind { color:#8a93a0; font:10px var(--font); }
.preview-frame { position:absolute; inset:0; width:100%; height:100%; border:0; background:#fff; z-index:5; }
.preview-wrap { position:absolute; inset:0; background:#fff; z-index:5; display:flex; flex-direction:column; }
.preview-bar { height:38px; flex:0 0 38px; display:flex; align-items:center; gap:8px; padding:0 10px; border-bottom:1px solid var(--line); background:#fafbfc; font-size:11px; color:#65707e; }
.preview-body { position:relative; flex:1; min-height:0; display:grid; grid-template-columns:1fr 1fr; }
.preview-code { margin:0; overflow:auto; padding:14px; border-right:1px solid var(--line); font:12px/1.65 var(--mono); white-space:pre-wrap; background:#fbfcfe; }
.preview-render { overflow:auto; padding:16px; line-height:1.7; }
.remote-caret { position:absolute; width:2px; background:currentColor; animation:blink 1s infinite; pointer-events:none; }
@keyframes blink { 50% { opacity:.2; } }

/* Chat */
.chat-panel { position:relative; }
.chat-head { height:54px; flex:0 0 54px; display:flex; align-items:center; gap:10px; padding:0 13px; background:#f7f7f7; border-bottom:1px solid #e7e7e7; }
.chat-head strong { font-size:13px; }
.chat-head .sub { color:#8c949d; font-size:10px; margin-top:2px; }
.chat-head .spacer { flex:1; }
.chat-messages { flex:1; min-height:0; overflow:auto; padding:14px 12px 18px; background:#f2f3f5; }
.chat-empty { text-align:center; color:#9aa2ac; font-size:12px; padding:40px 20px; line-height:1.8; }
.message-row { display:flex; gap:8px; margin:10px 0; align-items:flex-start; }
.message-row.mine { flex-direction:row-reverse; }
.message-avatar { flex:0 0 30px; width:30px; height:30px; border-radius:6px; display:grid; place-items:center; color:#fff; font-size:9px; font-weight:800; }
.message-stack { max-width:76%; min-width:0; }
.message-meta { display:flex; gap:7px; color:#99a0aa; font-size:9px; margin:0 4px 4px; }
.message-row.mine .message-meta { justify-content:flex-end; }
.bubble { position:relative; background:#fff; border-radius:10px; padding:9px 11px; font-size:12px; line-height:1.55; word-break:break-word; box-shadow:0 1px 2px rgba(20,25,35,.05); }
.message-row.mine .bubble { background:#95ec69; }
.bubble img { display:block; max-width:100%; max-height:270px; border-radius:7px; cursor:zoom-in; }
.file-card { display:flex; align-items:center; gap:9px; min-width:180px; color:inherit; text-decoration:none; }
.file-card-icon { width:34px; height:34px; flex:0 0 34px; border-radius:8px; background:rgba(0,0,0,.07); display:grid; place-items:center; font:700 9px var(--mono); }
.file-card-info { min-width:0; }
.file-card-name { display:block; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:700; }
.file-card-size { display:block; color:#7b8490; font-size:9px; margin-top:2px; }
.chat-composer { flex:0 0 auto; border-top:1px solid #e0e2e5; background:#fff; padding:9px; }
.composer-tools { display:flex; align-items:center; gap:4px; margin-bottom:7px; }
.composer-tools button { border:0; background:transparent; border-radius:7px; padding:5px 7px; color:#68717d; }
.composer-tools button:hover { background:#f2f4f6; color:#20242a; }
.composer-tools .spacer { flex:1; }
.typing-hint { color:#9aa2ac; font-size:10px; }
.chat-input-row { display:grid; grid-template-columns:1fr auto; gap:7px; align-items:end; }
.chat-input { width:100%; min-height:38px; max-height:110px; resize:none; border:1px solid #dde1e5; border-radius:9px; padding:9px 10px; outline:none; font-size:12px; line-height:1.5; }
.chat-input:focus { border-color:#aeb7c2; }
.send-btn { height:38px; border:0; border-radius:9px; padding:0 15px; color:#fff; background:#20242a; font-size:12px; font-weight:700; }
.send-btn:disabled { opacity:.45; cursor:not-allowed; }
.drop-mask { position:absolute; inset:0; display:none; place-items:center; background:rgba(47,128,237,.09); border:2px dashed #2f80ed; z-index:30; color:#2169c5; font-weight:700; }
.drop-mask.open { display:grid; }

/* Blog */
.blog-view { height:100%; width:100%; overflow:auto; padding:clamp(10px,1.15vw,22px); }
.blog-wrap { width:100%; max-width:none; margin:0; }
.blog-hero { display:flex; align-items:end; justify-content:space-between; gap:14px; margin:4px 0 14px; }
.blog-hero h2 { margin:0 0 5px; font-size:22px; letter-spacing:-.04em; }
.blog-hero p { margin:0; color:var(--muted); font-size:12px; }
.blog-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(10px,1.1vw,18px); align-items:start; }
.blog-column { min-width:0; background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; }
.blog-column-head { padding:15px 16px; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--line); }
.blog-column-head h3 { margin:0; font-size:14px; }
.blog-column-head p { margin:3px 0 0; color:var(--muted); font-size:10px; }
.blog-column-head .spacer { flex:1; }
.blog-posts { min-width:0; padding:clamp(10px,.9vw,16px); display:grid; gap:10px; min-height:120px; }
.blog-post { min-width:0; border:1px solid var(--line); border-radius:11px; padding:clamp(12px,1vw,18px); background:#fff; }
.blog-post h4 { margin:0 0 8px; font-size:14px; }
.blog-post-text { color:#555e6a; font-size:12px; line-height:1.7; white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-word; }
.blog-code { position:relative; max-width:100%; margin-top:11px; background:#1e252e; color:#e8edf4; border-radius:9px; padding:12px; overflow:auto; font:11px/1.6 var(--mono); white-space:pre; }
.blog-code button { position:absolute; top:7px; right:7px; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.08); color:#dfe6ef; border-radius:6px; padding:4px 7px; font-size:9px; }
.blog-post-foot { display:flex; align-items:center; gap:9px; margin-top:11px; color:#9aa2ac; font-size:9px; }
.blog-post-foot .spacer { flex:1; }
.blog-post-foot button { border:0; background:transparent; color:#69727e; font-size:10px; }
.blog-empty { text-align:center; color:var(--muted); font-size:12px; padding:28px 10px; }
.modal { position:fixed; inset:0; z-index:100; display:none; place-items:center; padding:18px; background:rgba(18,23,31,.42); backdrop-filter:blur(3px); }
.modal.open { display:grid; }
.modal-card { width:min(900px,calc(100vw - 36px)); max-height:90dvh; overflow:auto; background:#fff; border-radius:16px; box-shadow:0 30px 80px rgba(15,20,28,.28); }
.modal-head { padding:15px 17px; display:flex; align-items:center; border-bottom:1px solid var(--line); }
.modal-head h3 { margin:0; font-size:15px; }
.modal-head .spacer { flex:1; }
.modal-body { padding:16px; display:grid; gap:12px; }
.modal-body label { display:grid; gap:6px; font-size:11px; color:#68717e; }
.modal-body input, .modal-body textarea, .modal-body select { width:100%; border:1px solid var(--line-strong); border-radius:9px; padding:10px; outline:none; font-size:12px; }
.modal-body textarea { min-height:90px; resize:vertical; }
.modal-body textarea.code { min-height:170px; font:12px/1.6 var(--mono); }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; padding:0 16px 16px; }
.toast-stack { position:fixed; right:16px; top:70px; z-index:200; display:grid; gap:8px; }
.toast { min-width:220px; max-width:330px; padding:11px 13px; border-radius:10px; background:#20242a; color:#fff; font-size:12px; box-shadow:0 12px 30px rgba(20,26,36,.22); animation:toastIn .2s ease-out; }
.toast.error { background:#cb3048; }
.toast.success { background:#228158; }
@keyframes toastIn { from { transform:translateY(-7px); opacity:0; } }
.mobile-nav { display:none; }
.image-lightbox { position:fixed; inset:0; z-index:300; display:none; place-items:center; padding:20px; background:rgba(8,11,16,.86); }
.image-lightbox.open { display:grid; }
.image-lightbox img { max-width:96vw; max-height:90vh; border-radius:8px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns:230px minmax(320px,1fr) 320px; }
  .message-stack { max-width:82%; }
}
@media (max-width: 860px) {
  .login-shell { grid-template-columns:1fr; max-width:520px; }
  .login-brand { padding:34px; }
  .login-brand h1 { font-size:48px; }
  .login-card { padding:30px; }
  .app-page { overflow:hidden; }
  .topbar { height:46px; flex-basis:46px; padding:0 8px; gap:8px; }
  .logo span:last-child { display:none; }
  .top-nav { display:none; }
  .presence { display:none; }
  .user-pill span:last-child { display:none; }
  .workspace { display:block; padding:0; height:calc(100dvh - 46px - 56px); }
  .panel { border-left:0; border-right:0; border-bottom:0; border-radius:0; box-shadow:none; height:100%; }
  .workspace > .panel { display:none; }
  .workspace > .panel.mobile-active { display:flex; }
  .file-tools { grid-template-columns:1fr 1fr; }
  .editor-scroll { grid-template-columns:42px minmax(0,1fr); }
  .code-highlight, #codeArea { padding:12px 12px 40px; font-size:12px; }
  .line-numbers { padding-top:12px; font-size:12px; }
  .mobile-nav { height:56px; flex:0 0 56px; display:grid; grid-template-columns:repeat(4,1fr); background:#fff; border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); }
  .mobile-nav button { border:0; background:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color:#8a929d; font-size:10px; }
  .mobile-nav button.active { color:#20242a; font-weight:700; }
  .mobile-nav b { font-size:17px; line-height:1; }
  .blog-view { height:calc(100dvh - 46px - 56px); padding:9px; }
  .blog-columns { grid-template-columns:1fr; }
  .blog-hero { align-items:flex-start; flex-direction:column; }
  .blog-hero h2 { font-size:18px; }
  .toast-stack { top:60px; right:8px; left:8px; }
  .toast { max-width:none; }
}
@media (max-width: 520px) {
  .login-page { padding:12px; }
  .login-brand, .login-card { border-radius:18px; }
  .login-brand { padding:28px 24px; }
  .login-brand h1 { font-size:42px; }
  .brand-copy { font-size:14px; margin-bottom:22px; }
  .brand-points span { font-size:11px; }
  .login-card { padding:26px 22px; }
  .file-tools { padding:8px; }
  .editor-head { padding:0 8px; }
  .edit-status { padding:5px 7px; font-size:10px; }
  .panel-head { padding:0 9px; }
  .message-stack { max-width:85%; }
  .chat-messages { padding:10px 8px; }
  .preview-body { grid-template-columns:1fr; }
  .preview-code { display:none; }
}

/* Real-time merge marks */
.line.changed { background:rgba(32,36,42,.025); }
.line.changed-red { box-shadow:none; }
.line.changed-blue { box-shadow:none; }
.ins-mark { position:relative; border-radius:2px; background:color-mix(in srgb, var(--mark-color) 15%, transparent); box-shadow:none; }
.edit-anchor { position:relative; display:inline-block; width:0; height:0; overflow:visible; vertical-align:baseline; }
.del-mark { position:absolute; left:0; top:0; color:var(--mark-color); opacity:.92; white-space:pre; pointer-events:none; text-decoration:line-through; text-decoration-color:var(--mark-color); text-decoration-thickness:2px; transform:translateY(-.04em); }
.del-mark::selection { background:transparent; }
.ins-mark.ins-red { background:rgba(232,74,95,.15); }
.ins-mark.ins-blue { background:rgba(47,128,237,.15); }
.del-mark.del-red { color:#e84a5f; }
.del-mark.del-blue { color:#2f80ed; }
.ins-mark.ins-both { background:linear-gradient(90deg, rgba(232,74,95,.15), rgba(47,128,237,.15)); box-shadow:none; }

@media (max-width: 1180px) {
  .blog-columns { grid-template-columns:1fr; }
}

.chunk-controls { margin-left:auto; display:flex; align-items:center; gap:5px; color:#7b8491; font-size:10px; min-width:0; }
.chunk-controls.hidden { display:none; }
.chunk-controls button { padding:5px 8px; }
.chunk-controls input { width:72px; border:1px solid var(--line); border-radius:7px; padding:5px 7px; font-size:11px; outline:none; }
.chunk-controls input:focus { border-color:#aeb7c2; }
@media (max-width: 860px) {
  .editor-tabs { overflow:auto; }
  .chunk-controls { margin-left:8px; flex:0 0 auto; }
  .chunk-controls #chunkLabel { display:none; }
  .chunk-controls input { width:60px; }
}

.confirm-card, .prompt-card { width:min(440px,calc(100vw - 36px)); }
.dialog-text { margin:0; color:#4f5865; font-size:13px; line-height:1.7; word-break:break-word; }
.login-apk { margin:12px 0 0; text-align:center; }
.login-apk a { display:inline-block; padding:9px 14px; border-radius:9px; background:#eef1f5; color:#39414c; text-decoration:none; font-size:12px; font-weight:700; }
.login-apk a:hover { background:#e3e7ec; }
.remember-row { display:flex; grid-template-columns:auto 1fr; align-items:center; gap:8px; color:#555e6b; font-size:13px; }
.remember-row input { width:16px; height:16px; margin:0; accent-color:#20242a; }
.remember-row small { color:#9aa2ac; font-size:10px; margin-left:auto; }

/* Compact login layout */
@media (max-width: 860px) {
  .login-page { align-items:flex-start; padding:18px 14px; }
  .login-shell { display:block; width:100%; max-width:460px; margin:0 auto; padding-top:clamp(8px,6vh,48px); }
  .login-brand { display:none; }
  .login-card { padding:30px 24px; border-radius:18px; }
  .login-card-head { margin-bottom:20px; }
  .login-card h2 { font-size:25px; }
  .login-card form { margin-top:20px; gap:14px; }
  .login-tip { margin-top:16px; }
}
@media (max-width: 520px) {
  .login-page { padding:12px; }
  .login-shell { padding-top:10px; }
  .login-card { padding:24px 20px; }
  .login-card h2 { font-size:23px; }
  .login-card form { margin-top:18px; gap:12px; }
  .login-card input { padding:12px 13px; }
  .primary-btn { padding:13px 16px; }
}
@media (max-height: 700px) and (min-width: 861px) {
  .login-brand { padding:34px 42px; }
  .login-brand h1 { font-size:54px; }
  .brand-copy { margin:12px 0 20px; line-height:1.55; }
  .login-card { padding:28px 34px; }
  .login-card-head { margin-bottom:20px; }
  .login-card form { margin-top:20px; }
}

/* Mobile full-screen login */
@media (max-width: 860px) {
  .login-page { display:block; padding:0; min-height:100vh; min-height:100dvh; }
  .login-shell { display:flex; align-items:center; justify-content:center; width:100%; max-width:none; min-height:100vh; min-height:100dvh; margin:0; padding:0; }
  .login-brand { display:none; }
  .login-card { width:100%; max-width:none; min-height:100vh; min-height:100dvh; padding:32px 22px calc(32px + env(safe-area-inset-bottom)); border:0; border-radius:0; box-shadow:none; }
  .login-card > * { width:100%; max-width:420px; margin-left:auto; margin-right:auto; }
}
.ios-install-tip { margin:16px 0 0; padding:10px 12px; border-radius:10px; background:#eef4ff; color:#2f5f9e; font-size:11px; line-height:1.5; }
