:root { --primary: #2563eb; --primary-hover: #1d4ed8; --background: #c0cad5; --surface: #ffffff; --border: #e2e8f0; --text: #1e293b; --muted: #64748b;}
* { box-sizing: border-box; margin: 0; padding: 0;}
html, body { font-family: sans-serif; font-size: 16px;}
body { background: var(--background); color: var(--text); line-height: 1.5;}
.container { width: min(768px, 94%); margin: 0 auto;}
.page-header { background-color: var(--surface); padding: 1rem; text-align: center; margin-bottom: 1rem; line-height: 1.1; border-radius: 0 0 10px 10px;}
.page-header h1 { color: var(--primary); font-size: 2.5rem;}
.page-header p { color: var(--muted); font-size: 0.95rem;}
.generator { background: var(--surface); padding: 1.5rem; border: 1px solid var(--border); border-radius: 10px;}
.form-group { margin-bottom: 18px;}
.form-group label,
.link-section>label { display: block; margin-bottom: 7px; font-weight: 600;}
.form-group label span { color: var(--muted); font-weight: normal;}
input { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font-family: monospace; font-size: inherit; outline: none;}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(37 99 235 / 10%);}
button { padding: 11px 18px; border: none; border-radius: 6px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.2s;}
button:disabled { opacity: 0.5; cursor: not-allowed;}
.button-primary { width: 100%; background: var(--primary); color: white;}
.button-primary:hover:not(:disabled) { background: var(--primary-hover);}
.link-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border);}
.link-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px;}
.link-actions button { background: #e2e8f0; color: var(--text);}
.link-actions button:hover:not(:disabled) { background: #cbd5e1;}
#feedback { color: #15803d; font-size: 0.85rem;}
.preview-section { margin-top: 30px;}
.preview-section h2 { margin-bottom: 12px; font-size: 1.1rem;}
.preview { min-height: 220px; max-height: 550px; padding: 0; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 0.9rem;}
.preview p+p { margin-top: 10px;}
.page-footer { padding: 1rem 0; text-align: center; color: var(--muted); font-size: 0.8rem; background-color: var(--surface); margin-top: 1rem; border-radius: 10px 10px 0 0;}
@media (max-width: 500px) { 
 .page-header { padding-top: 28px; }
 .generator { padding: 18px; }
 .link-actions { align-items: flex-start; flex-direction: column; }
}
.document-header { padding: 8px 14px; background: #e2e8f0; color: #334155; font-size: 0.85rem; font-weight: 600; overflow-wrap: anywhere;}
.preview pre { margin: 0; padding: 16px; background: #0f172a; color: #e2e8f0; overflow: auto; font-family: Consolas, Monaco, monospace; font-size: 0.85rem; line-height: 1.6; white-space: pre;}
.preview code { font-family: inherit;}
body.viewer-page { background: #0f172a;}
body.viewer-page .container { width: 100%; max-width: none; margin: 0;}
body.viewer-page #document-viewer { min-height: 100vh;}
body.viewer-page #document-viewer pre { margin: 0; padding: 16px; overflow: auto; color: #e2e8f0; font-family: Consolas, Monaco, monospace; font-size: 0.85rem; line-height: 1.6; white-space: pre;}
.markdown-content { max-width: 900px; margin: 0 auto; padding: 32px; background: #ffffff; color: #1e293b; font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere;}
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 { margin: 1.5em 0 0.6em; line-height: 1.3;}
.markdown-content h1 { font-size: 2rem;}
.markdown-content h2 { font-size: 1.5rem;}
.markdown-content h3 { font-size: 1.2rem;}
.markdown-content p { margin: 1em 0;}
.markdown-content pre { padding: 16px; overflow-x: auto; border-radius: 6px; background: #0f172a; color: #e2e8f0;}
.markdown-content code { font-family: Consolas, Monaco, monospace;}
.markdown-content :not(pre)>code { padding: 2px 5px; border-radius: 4px; background: #e2e8f0;}
.markdown-content blockquote { margin: 1em 0; padding: 8px 16px; border-left: 4px solid #94a3b8; background: #f1f5f9;}
.markdown-content table { width: 100%; border-collapse: collapse; overflow-x: auto;}
.markdown-content th,
.markdown-content td { padding: 8px 12px; border: 1px solid #cbd5e1; text-align: left;}
.markdown-content img { max-width: 100%; height: auto;}
.markdown-content a { color: #2563eb;}
@media (max-width: 600px) {
 .markdown-content { padding: 20px 16px; }
}
.error-message { padding: 16px; color: #b42318; background: #fee4e2; border-radius: 6px;}
.helpbox { background-color: rgb(203, 255, 203); border: 1px solid green; border-radius: 10px; padding: .5rem .8rem; margin-bottom: 1.5rem;}
.preview-help { padding: 1.5rem;}
.preview { position: relative;}
.copy-code { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 5px 10px; color: #fff; background: #444; border: 0; border-radius: 4px; font-size: 12px; cursor: pointer;}
.copy-code:hover { background: #666;}
.preview pre, #document-viewer pre { padding: 0 !important;}
.hljs-ln-numbers {color: #64748b;text-align: right;padding-right: 12px;user-select: none;}
.hljs-ln td {padding: 0;}
.hljs-ln-code {padding-left: 12px !important;}