html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
    background-color: #f5f7fa;
    color: #222;
    line-height: 1.5;
}
.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 12px 40px;
}
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: #222;
    font-size: 17px;
    font-weight: 700;
}
.brand-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg,#2563eb,#7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-links a {
    display: block;
    padding: 8px 14px;
    border-radius: 6px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    transition: 0.15s;
}
.nav-links a:hover {
    background: #eef2ff;
    color: #2563eb;
}
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #333;
}
@media (max-width:768px) {
    .nav-toggle {
        display: flex;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 8px 12px 12px;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        padding: 11px 14px;
    }
}
.card {
    background:#fff;
    border-radius:8px;
    padding:16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.settings {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.settings h3 {
    font-size: 16px;
    margin-bottom: 10px;
}
.note {
    margin-top: 14px;
    font-size: 13px;
    color: #555;
}
.note ul {
    padding-left: 18px;
    margin-top: 4px;
}
.upload-area {
    border:2px dashed #cbd5e1;
    border-radius:6px;
    padding:32px 16px;
    text-align:center;
    cursor:pointer;
    transition:0.2s;
}
.upload-area:hover{
    border-color:#4080ff;
    background:#f7faff;
}
.upload-area.active{
    border-color:#2563eb;
    background:#eff6ff;
}
#fileInput{
    display:none;
}
.btn{
    background:#2563eb;
    color:#fff;
    border:none;
    padding:9px 16px;
    border-radius:6px;
    cursor:pointer;
    font-size:14px;
}
.btn:hover{
    background:#1d4ed8;
}
.btn-gray{
    background:#64748b;
}
.btn-gray:hover{
    background:#475569;
}
.row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin:10px 0;
}
.form-item{
    flex:1;
    min-width:130px;
}
label{
    display:block;
    font-size:13px;
    color:#444;
    margin-bottom:4px;
}
select,input[type="number"]{
    width:100%;
    padding:8px 10px;
    border:1px solid #d1d5db;
    border-radius:5px;
    font-size:14px;
}
.file-list{
    margin-top:12px;
    max-height:320px;
    overflow:auto;
}
.file-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 0;
    border-bottom:1px solid #eee;
    font-size:13px;
}
.thumb{
    width:42px;
    height:42px;
    object-fit:cover;
    border-radius:4px;
    background:#eee;
}
.action-bar{
    margin-top:14px;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.result-tip{
    font-size:13px;
    color:#22863a;
    margin-top:8px;
}
.url-area{
    width:100%;
    min-height:220px;
    resize:vertical;
    padding:12px 14px;
    border:1px solid #d1d5db;
    border-radius:8px;
    font-size:14px;
    font-family:inherit;
    color:#222;
}
.url-area:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,0.12);
}
.url-hint{
    font-size:13px;
    color:#666;
    margin-top:6px;
}
.checkbox-row{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:14px;
    font-size:14px;
    color:#333;
    cursor:pointer;
}
.checkbox-row input[type=checkbox]{
    width:16px;
    height:16px;
    cursor:pointer;
}
.result-area{
    width:100%;
    min-height:200px;
    resize:vertical;
    padding:12px 14px;
    border:1px solid #d1d5db;
    border-radius:8px;
    font-size:14px;
    font-family:inherit;
    color:#222;
    background:#fafbfc;
}
.result-area:focus{
    outline:none;
    border-color:#2563eb;
}
.section-title{
    font-size:14px;
    font-weight:600;
    display:block;
    margin:18px 0 8px;
}
.btn-outline{
    background:#fff;
    color:#2563eb;
    border:1px solid #2563eb;
}
.btn-outline:hover{
    background:#eff6ff;
}
.mode-btns{
    display:flex;
    gap:8px;
    margin-top:16px;
}
.mode-btn{
    flex:1;
    padding:10px 16px;
    border:1px solid #d1d5db;
    background:#fff;
    border-radius:6px;
    font-size:14px;
    cursor:pointer;
    color:#444;
}
.mode-btn.active{
    background:#2563eb;
    border-color:#2563eb;
    color:#fff;
}
.options-box{
    margin-top:16px;
    padding-top:14px;
    border-top:1px solid #eee;
}
.editor{
    width:100%;
    min-height:260px;
    resize:vertical;
    padding:12px 14px;
    border:1px solid #d1d5db;
    border-radius:8px;
    font-size:14px;
    font-family:inherit;
    color:#222;
    line-height:1.7;
}
.editor:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,0.12);
}
.stats{
    display:flex;
    flex-wrap:wrap;
    gap:10px 18px;
    margin-top:10px;
    font-size:13px;
    color:#555;
}
.stats span b{
    color:#2563eb;
    font-weight:600;
}
.tool-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:16px 0 0;
}
.tool-btn{
    padding:7px 13px;
    border:1px solid #d1d5db;
    background:#fff;
    border-radius:6px;
    font-size:13px;
    cursor:pointer;
    color:#444;
}
.tool-btn:hover{
    border-color:#2563eb;
    color:#2563eb;
}
.replace-row{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:16px;
    padding-top:14px;
    border-top:1px solid #eee;
}
.replace-row input[type=text]{
    flex:1;
    min-width:140px;
    padding:8px 10px;
    border:1px solid #d1d5db;
    border-radius:5px;
    font-size:14px;
}
.replace-row .btn{
    flex:0 0 auto;
}
.md-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}
@media (max-width:768px){
    .md-grid{
        grid-template-columns:1fr;
    }
}
.panel-head{
    font-size:13px;
    font-weight:600;
    color:#555;
    margin-bottom:6px;
}
.preview{
    border:1px solid #d1d5db;
    border-radius:8px;
    padding:12px 16px;
    min-height:420px;
    height:auto;
    max-height:600px;
    overflow:auto;
    background:#fff;
    font-size:14px;
    line-height:1.75;
    word-break:break-word;
    color:#222;
}
.preview > :first-child{
    margin-top:0;
}
.preview h1,.preview h2,.preview h3,.preview h4,.preview h5,.preview h6{
    margin:18px 0 10px;
    line-height:1.3;
    font-weight:600;
}
.preview h1{ font-size:26px; border-bottom:1px solid #eee; padding-bottom:6px; }
.preview h2{ font-size:22px; border-bottom:1px solid #eee; padding-bottom:6px; }
.preview h3{ font-size:18px; }
.preview h4{ font-size:16px; }
.preview h5{ font-size:14px; }
.preview h6{ font-size:13px; color:#777; }
.preview p{ margin:10px 0; }
.preview ul,.preview ol{ margin:10px 0; padding-left:24px; }
.preview li{ margin:4px 0; }
.preview a{ color:#2563eb; }
.preview code{
    background:#f1f5f9;
    border-radius:3px;
    padding:2px 5px;
    font-size:13px;
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.preview pre{
    background:#0f172a;
    color:#e2e8f0;
    padding:12px 14px;
    border-radius:6px;
    overflow:auto;
    margin:12px 0;
}
.preview pre code{
    background:none;
    color:inherit;
    padding:0;
}
.preview blockquote{
    border-left:4px solid #2563eb;
    background:#f8fafc;
    padding:8px 14px;
    margin:12px 0;
    color:#555;
}
.preview hr{
    border:none;
    border-top:1px solid #e2e8f0;
    margin:18px 0;
}
.preview img{
    max-width:100%;
    border-radius:4px;
}
