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: 12px;
}
.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);
}
.section {
    margin-top: 18px;
}
.section-title-lg {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}
.section-sub {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}
.note {
    margin-top: 14px;
    font-size: 13px;
    color: #555;
}
.note ul {
    padding-left: 18px;
    margin-top: 4px;
}
.hero {
    background:linear-gradient(135deg,#2563eb,#7c3aed);
    color:#fff;
    border-radius:14px;
    padding:34px 24px;
    text-align:center;
    margin-bottom:8px;
}
.hero h1 {
    font-size:28px;
    font-weight:800;
    margin-bottom:8px;
}
.hero p {
    font-size:15px;
    opacity:0.92;
}
.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;
}
.btn-outline {
    background:#fff;
    color:#2563eb;
    border:1px solid #2563eb;
}
.btn-outline:hover {
    background:#eff6ff;
}
.btn:disabled {
    opacity:0.55;
    cursor:not-allowed;
}
.row {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin:10px 0;
}
.form-item {
    flex:1;
    min-width:180px;
}
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;
}
input[type="range"] {
    width:100%;
    margin-top:9px;
    accent-color:#2563eb;
}
.engine-status {
    font-size:13px;
    margin:0 0 12px;
    padding:8px 10px;
    border-radius:6px;
    background:#f1f5f9;
    color:#64748b;
}
.engine-status.ok {
    background:#f0fdf4;
    color:#16a34a;
}
.engine-status.err {
    background:#fef2f2;
    color:#dc2626;
}
.action-bar {
    margin-top:14px;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.result-tip {
    font-size:13px;
    color:#22863a;
    margin-top:8px;
}
.upload-box {
    border:2px dashed #cbd5e1;
    border-radius:8px;
    padding:28px 16px;
    text-align:center;
    cursor:pointer;
    transition:0.2s;
}
.upload-box:hover {
    border-color:#4080ff;
    background:#f7faff;
}
.upload-box.active {
    border-color:#2563eb;
    background:#eff6ff;
}
.upload-box input {
    display:none;
}
.hint {
    font-size:13px;
    color:#666;
    margin-top:4px;
}
.img-meta {
    display:flex;
    flex-wrap:wrap;
    gap:8px 16px;
    margin-top:12px;
    font-size:13px;
    color:#555;
}
.settings {
    margin-top:16px;
    padding-top:16px;
    border-top:1px solid #eee;
}
.settings h3 {
    font-size:15px;
    font-weight:700;
    margin-bottom:10px;
}
.pick-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-top:12px;
    font-size:14px;
    color:#333;
}
.pick-actions {
    display:flex;
    gap:8px;
}
.mini-btn {
    padding:5px 12px;
    border:1px solid #d1d5db;
    background:#fff;
    border-radius:6px;
    cursor:pointer;
    font-size:13px;
    color:#444;
}
.mini-btn:hover {
    border-color:#2563eb;
    color:#2563eb;
}
.page-grid {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:12px;
}
.page-chip {
    width:56px;
    height:64px;
    border:1px solid #d1d5db;
    border-radius:6px;
    background:#fff;
    cursor:pointer;
    font-size:13px;
    color:#444;
    text-align:center;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:0.15s;
}
.page-chip:hover {
    border-color:#2563eb;
    color:#2563eb;
}
.page-chip.on {
    background:#2563eb;
    border-color:#2563eb;
    color:#fff;
}
.result-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
    gap:12px;
    margin-top:16px;
}
.result-card {
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:8px;
    overflow:hidden;
}
.result-thumb {
    width:100%;
    height:150px;
    object-fit:contain;
    background:#f8fafc;
}
.result-thumb.err {
    display:flex;
    align-items:center;
    justify-content:center;
    color:#dc2626;
    font-size:13px;
}
.result-info {
    padding:8px 10px;
    font-size:12px;
}
.result-info .r-name {
    color:#222;
    font-weight:600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.result-info .r-meta {
    color:#777;
    margin-top:2px;
}
.result-info button {
    margin-top:8px;
    width:100%;
    padding:6px 0;
    border:1px solid #2563eb;
    background:#fff;
    color:#2563eb;
    border-radius:6px;
    cursor:pointer;
    font-size:12px;
}
.result-info button:hover {
    background:#eff6ff;
}
@media (max-width:768px) {
    .hero {
        padding:26px 18px;
    }
    .hero h1 {
        font-size:24px;
    }
}
