/* TXT-to-Markdown studio: quiet editorial paper & liquid-glass dialog. */
.md-writer-pill { display:inline-flex; align-items:center; gap:7px; padding:8px 15px; border-radius:30px; border:1px solid var(--rule); font-size:12px; font-weight:500; letter-spacing:.02em; background:#ffffff52; color:var(--ink); transition:transform .25s,box-shadow .25s,background .25s; white-space:nowrap; }
.md-writer-pill .ui-icon { width:15px; height:15px; }
.md-writer-pill:hover { transform:translateY(-2px); }
.md-writer-pill:active { transform:scale(.97); }
.section-heading-actions { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.md-inline-trigger { display:inline-flex; align-items:center; gap:6px; padding:6px 13px; border:1px solid var(--rule); border-radius:20px; background:#ffffff38; color:var(--ink); font-size:12px; transition:background .25s,border-color .25s,transform .2s; }
.md-inline-trigger .ui-icon { width:14px; height:14px; }
.md-inline-trigger:hover { background:#a7bba128; border-color:#7c937948; transform:translateY(-1px); }

.md-studio-dialog { width:min(1060px,calc(100vw - 28px)); max-width:none; max-height:calc(100dvh - 30px); margin:auto; padding:24px 26px 20px; border:1px solid #ffffffb5; border-radius:24px; background:#f4f5eef8; color:#273d36; box-shadow:0 28px 90px #152b2538; overflow:hidden; }
.md-studio-dialog[open] { display:flex; flex-direction:column; gap:14px; }
.md-studio-dialog::backdrop { background:#14222d78; -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
.md-studio-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.md-studio-eyebrow { font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:#68766e; }
.md-studio-header h2 { font:400 24px/1.3 var(--serif); margin-top:3px; letter-spacing:-.02em; }
.md-studio-sub { font-size:12px; color:#68766e; margin-top:4px; }
.md-studio-top-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.md-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:7px 13px; border:1px solid #6a7d6338; border-radius:10px; background:#ffffff70; color:inherit; font-size:12px; line-height:1.2; min-height:34px; transition:background .2s,border-color .2s,transform .15s; }
.md-btn .ui-icon { width:14px; height:14px; }
.md-btn:hover { background:#e3ebe1; border-color:#6a7d6366; }
.md-btn:active { transform:scale(.98); }
.md-btn-primary { background:#35584a; color:#f7f8f2; border-color:#35584a; }
.md-btn-primary:hover { background:#2a483c; border-color:#2a483c; }
.md-close-btn { width:36px; height:36px; padding:0; border-radius:50%; font-size:22px; line-height:1; }

.md-studio-controls { display:flex; flex-direction:column; gap:10px; padding:12px 14px; border:1px solid #6a7d6324; border-radius:14px; background:#ffffff66; }
.md-option-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; font-size:12px; }
.md-check { display:inline-flex; align-items:center; gap:6px; cursor:pointer; user-select:none; color:#3a5248; }
.md-check input { accent-color:#4b7160; margin:0; cursor:pointer; }
.md-check-accent { font-weight:600; color:#273d36; }
.md-meta-row { display:grid; grid-template-columns:1.4fr 1fr 1.2fr; gap:10px; padding-top:10px; border-top:1px dashed #6a7d6328; }
.md-field { display:flex; flex-direction:column; gap:4px; font-size:11px; color:#68766e; }
.md-field input { height:32px; padding:0 10px; border:1px solid #6a7d6334; border-radius:8px; background:#fff; color:#273d36; font-size:12px; outline:none; }
.md-field input:focus { border-color:#5f8371; box-shadow:0 0 0 3px #5f83711c; }

.md-studio-panes { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:14px; flex:1 1 auto; min-height:clamp(260px,46dvh,470px); overflow:hidden; }
.md-pane { display:flex; flex-direction:column; min-height:0; border:1px solid #6a7d632b; border-radius:16px; background:#ffffffb5; overflow:hidden; transition:border-color .2s,box-shadow .2s; }
.md-pane.is-dragover { border-color:#4b7160; box-shadow:inset 0 0 0 2px #4b716040; }
.md-pane-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 14px; border-bottom:1px solid #6a7d6320; background:#edf1ea85; font-size:12px; }
.md-pane-title { font-weight:600; color:#273d36; display:inline-flex; align-items:center; gap:7px; }
.md-pane-badge { font-size:11px; color:#68766e; font-variant-numeric:tabular-nums; }
.md-tab-group { display:inline-flex; gap:4px; padding:2px; border-radius:8px; background:#6a7d6318; }
.md-tab-btn { padding:4px 10px; border:0; border-radius:6px; background:transparent; color:#55675f; font-size:11px; font-weight:500; }
.md-tab-btn[aria-selected=true] { background:#fff; color:#273d36; box-shadow:0 1px 4px #273d3616; }

.md-editor-area,.md-output-area { flex:1 1 auto; width:100%; min-height:220px; border:0; resize:none; padding:14px 16px; background:transparent; color:#223630; font:13px/1.75 'SFMono-Regular',Consolas,'Microsoft YaHei',monospace; outline:none; overflow:auto; overscroll-behavior:contain; }
.md-output-area { background:#fafbf8; }
.md-preview { flex:1 1 auto; min-height:220px; padding:16px 18px; overflow:auto; overscroll-behavior:contain; font-size:14px; line-height:1.8; color:#273d36; }
.md-preview-empty { color:#68766e; font-size:13px; text-align:center; padding:48px 18px; }
.md-preview-fm { display:flex; flex-direction:column; gap:4px; padding:10px 13px; margin-bottom:16px; border:1px solid #6a7d632c; border-radius:10px; background:#edf2ea88; }
.md-fm-badge { font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:#5c7565; }
.md-preview-fm strong { font:500 16px/1.4 var(--serif); }
.md-fm-meta { font-size:11px; color:#68766e; }
.md-preview h1,.md-preview h2,.md-preview h3,.md-preview h4 { font-family:var(--serif); font-weight:600; margin:16px 0 8px; line-height:1.4; }
.md-preview h1 { font-size:22px; padding-bottom:6px; border-bottom:1px solid #6a7d6326; }
.md-preview h2 { font-size:18px; }
.md-preview h3 { font-size:15px; }
.md-preview p { margin:8px 0; }
.md-preview ul,.md-preview ol { margin:8px 0; padding-left:22px; }
.md-preview li { margin:4px 0; }
.md-task-item { list-style:none; margin-left:-18px; display:flex; align-items:baseline; gap:7px; }
.md-task-box { display:inline-grid; place-items:center; width:14px; height:14px; border:1px solid #6a7d6370; border-radius:3px; font-size:10px; color:#35584a; flex-shrink:0; }
.md-task-item.is-done { color:#68766e; text-decoration:line-through; }
.md-preview blockquote { margin:10px 0; padding:8px 13px; border-left:3px solid #6d8c78; background:#edf2ea80; border-radius:0 8px 8px 0; color:#42584f; }
.md-preview code { padding:1px 5px; border-radius:5px; background:#6a7d631a; font-family:'SFMono-Regular',Consolas,monospace; font-size:12px; }
.md-preview-code { position:relative; margin:10px 0; padding:12px 14px; border-radius:10px; background:#23322d; color:#e9f1ec; overflow:auto; font-size:12px; line-height:1.6; }
.md-preview-code code { padding:0; background:none; color:inherit; }
.md-preview-code[data-lang]::before { content:attr(data-lang); position:absolute; right:10px; top:6px; font-size:10px; text-transform:uppercase; color:#9eb7aa; }
.md-preview hr { border:0; border-top:1px solid #6a7d6330; margin:14px 0; }
.md-preview a { color:#366a55; text-decoration:underline; text-underline-offset:3px; }
.md-preview-table-wrap { overflow:auto; margin:10px 0; }
.md-preview table { width:100%; border-collapse:collapse; font-size:12px; }
.md-preview th,.md-preview td { padding:6px 10px; border:1px solid #6a7d6334; text-align:left; }
.md-preview th { background:#edf2ea; font-weight:600; }

.md-studio-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-top:6px; border-top:1px solid #6a7d6322; }
.md-status-group { display:flex; flex-direction:column; gap:2px; min-width:0; }
.md-status { font-size:12px; color:#3d584d; }
.md-privacy-hint { font-size:11px; color:#68766e; }
.md-export-group { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.md-filename-input { width:190px; height:34px; padding:0 10px; border:1px solid #6a7d6338; border-radius:10px; background:#fff; color:#273d36; font-size:12px; outline:none; }
.md-filename-input:focus { border-color:#5f8371; }

/* Anime dark theme harmonization */
html[data-blog-style=anime] .md-writer-pill,
html[data-blog-style=anime] .md-inline-trigger { color:#fff5ee; border-color:#ffffff3c; background:#29233099; }
html[data-blog-style=anime] .md-inline-trigger:hover { background:#ffe4bd24; border-color:#ffe4bd52; }
html[data-blog-style=anime] .md-studio-dialog { background:#252030fa; color:#f7ebe3; border-color:#ffffff38; box-shadow:0 28px 90px #07050c88; }
html[data-blog-style=anime] .md-studio-eyebrow,
html[data-blog-style=anime] .md-studio-sub,
html[data-blog-style=anime] .md-field,
html[data-blog-style=anime] .md-pane-badge,
html[data-blog-style=anime] .md-privacy-hint,
html[data-blog-style=anime] .md-preview-empty,
html[data-blog-style=anime] .md-fm-meta { color:#cbbecb; }
html[data-blog-style=anime] .md-studio-controls { background:#31293d99; border-color:#ffffff24; }
html[data-blog-style=anime] .md-check,
html[data-blog-style=anime] .md-check-accent,
html[data-blog-style=anime] .md-pane-title,
html[data-blog-style=anime] .md-status { color:#f7ebe3; }
html[data-blog-style=anime] .md-check input { accent-color:#edc9a4; }
html[data-blog-style=anime] .md-btn { background:#ffffff14; border-color:#ffffff30; color:#f7ebe3; }
html[data-blog-style=anime] .md-btn:hover { background:#edc9a426; border-color:#edc9a466; }
html[data-blog-style=anime] .md-btn-primary { background:#edc9a4; border-color:#edc9a4; color:#2b1f30; font-weight:600; }
html[data-blog-style=anime] .md-btn-primary:hover { background:#f5d8b8; }
html[data-blog-style=anime] .md-field input,
html[data-blog-style=anime] .md-filename-input { background:#1d1826; border-color:#ffffff2c; color:#f7ebe3; }
html[data-blog-style=anime] .md-pane { background:#1e1928e0; border-color:#ffffff24; }
html[data-blog-style=anime] .md-pane.is-dragover { border-color:#edc9a4; box-shadow:inset 0 0 0 2px #edc9a455; }
html[data-blog-style=anime] .md-pane-head { background:#2d2539b0; border-color:#ffffff1c; }
html[data-blog-style=anime] .md-tab-group { background:#ffffff14; }
html[data-blog-style=anime] .md-tab-btn { color:#cbbecb; }
html[data-blog-style=anime] .md-tab-btn[aria-selected=true] { background:#edc9a4; color:#2b1f30; }
html[data-blog-style=anime] .md-editor-area,
html[data-blog-style=anime] .md-output-area,
html[data-blog-style=anime] .md-preview { color:#f7ebe3; }
html[data-blog-style=anime] .md-output-area { background:#181421; }
html[data-blog-style=anime] .md-preview-fm { background:#31293db0; border-color:#ffffff28; }
html[data-blog-style=anime] .md-fm-badge,
html[data-blog-style=anime] .md-preview a { color:#edc9a4; }
html[data-blog-style=anime] .md-preview blockquote { background:#31293d90; border-left-color:#edc9a4; color:#eadbe0; }
html[data-blog-style=anime] .md-preview code { background:#ffffff1a; }
html[data-blog-style=anime] .md-preview-code { background:#120f1a; border:1px solid #ffffff1c; }
html[data-blog-style=anime] .md-preview th { background:#31293d; }
html[data-blog-style=anime] .md-preview th,
html[data-blog-style=anime] .md-preview td { border-color:#ffffff24; }

@media(max-width:860px) {
  .md-studio-dialog { padding:18px 16px 16px; border-radius:18px; overflow:auto; }
  .md-studio-panes { grid-template-columns:1fr; min-height:0; overflow:visible; }
  .md-editor-area,.md-output-area,.md-preview { min-height:190px; max-height:36dvh; }
  .md-meta-row { grid-template-columns:1fr; }
}
@media(max-width:600px) {
  .md-writer-pill { padding:7px 12px; font-size:11px; min-height:38px; }
  .md-filename-input { width:100%; }
  .md-export-group { width:100%; }
  .md-export-group .md-btn { flex:1 1 auto; }
}
