/* Markdown 即时预览 */
.app-card--markdown { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.app-icon.md-mini {
    border: 0; padding: 0; cursor: pointer; background: transparent; overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 16px rgba(15,23,42,.16), 0 1px 3px rgba(15,23,42,.12);
    transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease;
}
.app-icon.md-mini:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 14px 28px rgba(15,23,42,.22); }
.app-icon.md-mini img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }

.md-panel {
    position: relative; width: min(980px, 100%); height: min(82vh, 700px); display: flex; flex-direction: column;
    border-radius: 16px; background: #fff; color: #1e293b; overflow: hidden;
    box-shadow: 0 28px 80px rgba(8,12,22,.34);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}
.md-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 12px 18px; border-bottom: 1px solid rgba(15,23,42,.08); }
.md-title { margin: 0; font-size: 15px; font-weight: 600; }
.md-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.md-tools button {
    border: 1px solid transparent; background: #f1f5f9; color: #334155; border-radius: 7px;
    padding: 4px 9px; font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.md-tools button:hover { background: #e2e8f0; }
.md-split { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.md-editor {
    width: 100%; height: 100%; box-sizing: border-box; border: 0; border-right: 1px solid rgba(15,23,42,.08);
    padding: 16px 18px; resize: none; outline: none; background: #f8fafc; color: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.65;
}
.md-preview {
    padding: 16px 22px; overflow-y: auto; font-size: 14px; line-height: 1.7; word-break: break-word;
}
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 14px 0 8px; line-height: 1.3; }
.md-preview h1 { font-size: 22px; border-bottom: 1px solid rgba(15,23,42,.1); padding-bottom: 6px; }
.md-preview h2 { font-size: 18px; }
.md-preview h3 { font-size: 15.5px; }
.md-preview p { margin: 8px 0; }
.md-preview code { background: rgba(15,23,42,.07); padding: 2px 5px; border-radius: 5px; font-family: ui-monospace, monospace; font-size: 12.5px; }
.md-preview pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 10px 0; }
.md-preview pre code { background: transparent; padding: 0; color: inherit; }
.md-preview blockquote { margin: 10px 0; padding: 6px 12px; border-left: 3px solid #3b82f6; background: rgba(59,130,246,.06); border-radius: 0 8px 8px 0; }
.md-preview ul, .md-preview ol { padding-left: 22px; margin: 8px 0; }
.md-preview table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.md-preview th, .md-preview td { border: 1px solid #e2e8f0; padding: 6px 10px; text-align: left; }
.md-preview th { background: #f8fafc; }
.md-preview a { color: #2563eb; }
.md-foot { display: flex; align-items: center; justify-content: space-between; padding: 9px 18px; border-top: 1px solid rgba(15,23,42,.08); font-size: 12px; color: #64748b; gap: 10px; }
.md-foot-acts { display: flex; gap: 8px; }
.md-foot-acts button { border: 0; background: #f1f5f9; color: #334155; border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer; font-weight: 500; }
.md-foot-acts button.is-primary { background: #2563eb; color: #fff; }
@media (max-width: 720px) { .md-split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } .md-editor { border-right: 0; border-bottom: 1px solid rgba(15,23,42,.08); } }
:root[data-theme="dark"] .md-panel { background: #1b1f26; color: #f1f5f9; }
:root[data-theme="dark"] .md-head, :root[data-theme="dark"] .md-foot, :root[data-theme="dark"] .md-editor { border-color: rgba(255,255,255,.08); }
:root[data-theme="dark"] .md-editor { background: #14181f; color: #e2e8f0; }
:root[data-theme="dark"] .md-tools button, :root[data-theme="dark"] .md-foot-acts button { background: rgba(255,255,255,.08); color: #e2e8f0; }
:root[data-theme="dark"] .md-foot-acts button.is-primary { background: #3b82f6; color: #fff; }
:root[data-theme="dark"] .md-preview code { background: rgba(255,255,255,.1); }
:root[data-theme="dark"] .md-preview th { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .md-preview th, :root[data-theme="dark"] .md-preview td { border-color: rgba(255,255,255,.1); }
