/* Apple Liquid Glass foundation — shared by all seal generators. */
:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --hover: #fbfbfd;
    --text: #1d1d1f;
    --text-body: #424245;
    --text-2: #6e6e73;
    --text-3: #86868b;
    --text-4: #aeaeb2;
    --faint: #d2d2d7;
    --hairline: rgba(0, 0, 0, 0.07);
    --accent: #0071e3;
    --accent-link: #0066cc;
    --indigo: #5e5ce6;
    --live: #30d158;
    --track: #e8e8ed;
    --grad-cta: linear-gradient(135deg, #0071e3 0%, #5e5ce6 100%);
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
        'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --r-pill: 999px;
    --r-thumb: 12px;
    --r-card: 18px;
    --r-panel: 22px;
    --r-hero: 26px;
    --sh-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
    --sh-panel: 0 1px 3px rgba(0, 0, 0, 0.05), 0 14px 40px rgba(0, 0, 0, 0.05);
    --sh-lift: 0 12px 32px rgba(0, 0, 0, 0.1);
    --sh-cta: 0 20px 54px rgba(0, 113, 227, 0.24);
    --max-grid: 1080px;
    --pad-x: 22px;
    --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    /* Compatibility aliases for small legacy page-specific styles. */
    --primary: var(--accent);
    --primary-dark: var(--accent-link);
    --card-bg: var(--surface);
    --card-border: var(--hairline);
    --text-primary: var(--text);
    --text-secondary: var(--text-2);
    --shadow: var(--sh-card);
    --shadow-lg: var(--sh-panel);
    --shadow-hover: var(--sh-lift);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }

.site-nav,
body > header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(245, 245, 247, 0.72);
    border-bottom: 1px solid transparent;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    transition: border-color .3s var(--ease-out-quart), box-shadow .3s var(--ease-out-quart);
}
.site-nav.scrolled,
body > header.scrolled { border-bottom-color: var(--hairline); box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04); }
.nav-inner,
.header-content {
    width: min(100%, var(--max-grid));
    min-height: 54px;
    margin: 0 auto;
    padding: 0 var(--pad-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { color: var(--text); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.product-nav { display: flex; align-items: center; gap: 4px; }
.product-nav a,
.back-link,
.back-button {
    min-height: 36px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--r-pill);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 550;
    line-height: 1;
    text-decoration: none;
    transition: background .2s var(--ease-out-quart), color .2s var(--ease-out-quart), transform .1s ease-out;
}
.product-nav a:hover,
.back-link:hover,
.back-button:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
.product-nav a:active,
.back-link:active,
.back-button:active,
button:active { transform: scale(.97); }
.product-nav a[aria-current='page'] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.product-nav .network-tool-link {
    margin-left: 5px;
    color: var(--accent-link);
    background: rgba(0, 113, 227, .08);
    font-weight: 650;
}
.product-nav .network-tool-link:hover { background: rgba(0, 113, 227, .14); color: var(--accent-link); }
.network-tool-link span { margin-left: 4px; font-size: 12px; }

.page-hero { width: min(100%, var(--max-grid)); margin: 0 auto; padding: clamp(38px, 6vw, 64px) var(--pad-x) clamp(25px, 4vw, 34px); }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: .13em; }
.eyebrow::before { width: 7px; height: 7px; content: ''; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(48, 209, 88, .5); animation: pulse-dot 2.2s infinite; }
.page-hero h1,
header h1 { margin: 13px 0 0; color: var(--text); font-size: clamp(30px, 5vw, 46px); font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.lede { width: 100%; margin: 14px 0 0; color: var(--text-2); font-size: clamp(14px, 2vw, 16px); line-height: 1.65; overflow-wrap: break-word; }

main { width: min(100%, var(--max-grid)); margin: 0 auto; padding: 0 var(--pad-x) clamp(40px, 6vw, 64px); }
.app-container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .88fr); overflow: hidden; width: 100%; background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--sh-panel); }
.controls,
.preview-area { min-width: 0; }
.controls { display: flex; flex-direction: column; padding: clamp(22px, 3.5vw, 34px); }
.controls > h2,
.preview-area > h2 { margin: 0; color: var(--text); font-size: 18px; font-weight: 650; letter-spacing: -.015em; line-height: 1.35; }
.controls > h2::after { display: block; margin-top: 6px; content: '修改参数后，预览将即时更新'; color: var(--text-3); font-size: 12px; font-weight: 450; letter-spacing: 0; }
.control-group { display: grid; gap: 0; margin: 20px 0 0; }
.control-group + .control-group { padding-top: 20px; border-top: 1px solid var(--hairline); }
.control-item { display: grid; gap: 8px; padding: 12px 0; }
.control-item + .control-item { border-top: 1px solid var(--hairline); }
label { color: var(--text); font-size: 13px; font-weight: 600; letter-spacing: -.005em; }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.range-label output { color: var(--accent-link); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 650; }
.input-hint { margin: 0; color: var(--text-3); font-size: 11px; line-height: 1.5; }
input[type='text'],
select { width: 100%; min-height: 44px; padding: 0 14px; appearance: none; border: 1px solid var(--hairline); border-radius: var(--r-thumb); outline: none; background: var(--surface); color: var(--text); font: 400 14px/1.4 var(--font); transition: border-color .2s var(--ease-out-quart), box-shadow .2s var(--ease-out-quart), background .2s var(--ease-out-quart); }
select { padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
input[type='text']::placeholder { color: var(--text-4); }
input[type='text']:hover, select:hover { background-color: var(--hover); }
input[type='text']:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 113, 227, .14); }
input[type='range'] { width: 100%; height: 44px; margin: 0; appearance: none; outline: none; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 5px; border-radius: var(--r-pill); background: var(--track); }
input[type='range']::-moz-range-track { height: 5px; border-radius: var(--r-pill); background: var(--track); }
input[type='range']::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7.5px; appearance: none; border: 3px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s var(--ease-out-quart); }
input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border: 3px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
input[type='range']:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type='color'] { width: 100%; height: 44px; padding: 4px; border: 1px solid var(--hairline); border-radius: var(--r-thumb); background: var(--surface); cursor: pointer; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-item { display: inline-flex; align-items: center; min-height: 40px; padding: 0 13px; border: 1px solid var(--hairline); border-radius: var(--r-pill); color: var(--text-2); font-size: 13px; cursor: pointer; transition: background .2s var(--ease-out-quart), border-color .2s var(--ease-out-quart), color .2s var(--ease-out-quart); }
.radio-item:hover { border-color: rgba(0, 113, 227, .35); background: rgba(0, 113, 227, .05); color: var(--text); }
input[type='radio'] { width: 15px; height: 15px; margin: 0 7px 0 0; accent-color: var(--accent); }
.btn-group { display: flex; gap: 10px; margin-top: 24px; }
button { min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--r-pill); cursor: pointer; font: 600 14px/1 var(--font); transition: transform .1s ease-out, background .2s var(--ease-out-quart), box-shadow .2s var(--ease-out-quart); }
.btn-group button { flex: 1; }
.btn-main { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(0, 113, 227, .2); }
.btn-main:hover { background: var(--accent-link); box-shadow: 0 12px 28px rgba(0, 113, 227, .28); }
.btn-sub { border: 1px solid var(--hairline); background: var(--surface); color: var(--text); }
.btn-sub:hover { background: var(--hover); }

.preview-area { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(22px, 3.5vw, 34px); border-left: 1px solid var(--hairline); background: linear-gradient(180deg, #fbfbfd 0%, var(--surface) 48%); }
.preview-area > h2 { margin-top: 0; }
.preview-area > h2::after { display: block; margin-top: 6px; content: '在画布中查看生成效果'; color: var(--text-3); font-size: 12px; font-weight: 450; letter-spacing: 0; text-align: center; }
canvas { display: block; width: min(100%, 400px); height: auto; margin-top: 24px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--sh-card); }
canvas[width='300'] { width: min(100%, 300px); }
.preview-area > p { margin: 12px 0 0; color: var(--text-3) !important; font-size: 12px !important; text-align: center; }
.mini-program-card { order: 3; display: grid; grid-template-columns: clamp(144px, 16vw, 176px) minmax(0, 1fr); align-items: center; gap: 18px; width: min(100%, 410px); margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.mini-program-card img { width: 100%; aspect-ratio: 1; height: auto; padding: 8px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--sh-card); }
.mini-program-info h3 { margin: 0; color: var(--text); font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.mini-program-info p { margin: 4px 0 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }

.faq-section { margin-top: clamp(34px, 6vw, 56px); }
.faq-section > h2 { margin: 0 0 22px; color: var(--text); font-size: clamp(22px, 3.4vw, 26px); font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.faq-list { padding: 0 clamp(22px, 3.5vw, 34px); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--sh-card); }
.faq-item { display: grid; grid-template-columns: minmax(200px, .8fr) minmax(0, 1.4fr); align-items: start; gap: clamp(18px, 3vw, 36px); padding: 1.5rem 0; }
.faq-item + .faq-item { border-top: 1px solid var(--hairline); }
.faq-item h3 { margin: 0; color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.5; }
.faq-item p { min-width: 0; margin: 0; color: var(--text-body); font-size: clamp(15px, 2vw, 16px); line-height: 1.85; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.faq-item a { color: var(--accent-link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.faq-item a:hover { text-decoration: none; }
.faq-item a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.banner-notice-content { min-width: 0; }
.banner-notice-title { margin: 0; color: var(--text); font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.banner-notice-desc { margin: 3px 0 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.banner-section { width: 100%; margin-top: clamp(34px, 6vw, 56px); }
.banner-notice { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; overflow: hidden; padding: clamp(24px, 4vw, 38px); border-radius: var(--r-hero); background: #0071e3; box-shadow: var(--sh-cta); }
.banner-notice::before, .banner-notice::after { position: absolute; border-radius: 50%; content: ''; pointer-events: none; }
.banner-notice::before { top: -92px; right: -46px; width: 260px; height: 260px; background: rgba(255,255,255,.18); filter: blur(46px); }
.banner-notice::after { bottom: -100px; left: 10%; width: 210px; height: 210px; background: rgba(120,80,255,.5); filter: blur(50px); }
.banner-notice::before, .banner-notice::after { display: none; }
.banner-notice-content, .banner-notice > a { position: relative; z-index: 1; }
.banner-notice .banner-notice-title { color: #fff; font-size: clamp(17px, 2.5vw, 22px); font-weight: 700; letter-spacing: -.02em; line-height: 1.4; }
.banner-notice .banner-notice-desc { max-width: 620px; margin: 9px 0 0; color: rgba(255, 255, 255, .83); font-size: 14px; line-height: 1.6; }
.banner-notice-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 19px; border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--r-pill); background: rgba(255, 255, 255, .16); color: #fff; font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .2s var(--ease-out-quart), background .2s var(--ease-out-quart); }
.banner-notice-cta:hover { background: rgba(255, 255, 255, .25); transform: translateY(-2px); }

footer { padding: 0 var(--pad-x) 22px; border-top: 1px solid var(--hairline); background: var(--surface); color: var(--text-2); }
.footer-inner,
.footer-bottom { width: min(100%, var(--max-grid)); margin: 0 auto; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: clamp(28px, 7vw, 72px); align-items: start; padding: 34px 0 28px; }
.footer-brand { display: inline-flex; align-items: center; color: var(--text); font-size: 16px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.footer-brand:hover { color: var(--accent-link); }
.footer-tagline { max-width: 360px; margin: 10px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.65; }
.footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 24px; margin: 0; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text-2); font-size: 13px; text-decoration: none; transition: color .2s var(--ease-out-quart), background .2s var(--ease-out-quart); }
.footer-nav a:hover { color: var(--accent-link); }
.footer-nav a:focus-visible,
.footer-author-link:focus-visible { outline: 2px solid rgba(0, 113, 227, .45); outline-offset: 3px; }
.footer-nav span { margin-left: 5px; color: var(--accent-link); font-size: 12px; }
.footer-nav .footer-tool-link { width: max-content; padding: 0 11px; border: 1px solid rgba(0, 113, 227, .16); border-radius: var(--r-pill); background: rgba(0, 113, 227, .06); color: var(--accent-link); font-weight: 650; }
.footer-nav .footer-tool-link:hover { background: rgba(0, 113, 227, .12); color: var(--accent-link); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0 0; border-top: 1px solid var(--hairline); color: var(--text-3); font-size: 12px; line-height: 1.5; }
.footer-author-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border: 1px solid rgba(0, 113, 227, .18); border-radius: var(--r-pill); background: rgba(0, 113, 227, .06); color: var(--accent-link) !important; font-weight: 650; text-decoration: none; transition: background .2s var(--ease-out-quart), transform .1s ease-out; }
.footer-author-link:hover { background: rgba(0, 113, 227, .12); transform: translateY(-1px); }
.footer-author-link span { margin-left: 5px; font-size: 12px; }
.footer-author-link:active { transform: scale(.97); }

@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, .5); } 70% { box-shadow: 0 0 0 7px rgba(48, 209, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); } }
@media (min-width: 681px) {
    /* Keep the complete parameter set visible without turning the form into a scroll box. */
    .page-hero { padding: 28px var(--pad-x) 20px; }
    .page-hero h1 { margin-top: 10px; font-size: clamp(30px, 4.5vw, 40px); }
    .lede { margin-top: 10px; line-height: 1.6; }
    .controls { padding: 24px clamp(22px, 3vw, 30px); }
    .controls > h2::after { margin-top: 6px; font-size: 12px; }
    .control-group { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 18px; margin-top: 14px; }
    .control-item { min-width: 0; grid-template-columns: 1fr; align-items: start; row-gap: 6px; padding: 6px 0; }
    .control-item + .control-item { border-top: 0; }
    .control-group + .control-group { padding-top: 10px; }
    .control-item:has(.radio-group) { grid-column: 1 / -1; grid-template-columns: 1fr; align-items: start; row-gap: 6px; }
    .control-item:has(.radio-group) .radio-group { justify-content: flex-start; }
    .control-item:has(.input-hint) { grid-column: auto; grid-template-columns: minmax(82px, .72fr) minmax(0, 1.28fr); grid-template-rows: auto auto; align-items: center; padding-bottom: 1px; }
    .control-item:has(.input-hint) .input-hint { grid-column: 1 / -1; }
    .control-item:has(.input-hint) .range-label { gap: 6px; font-size: 12px; }
    .input-hint { font-size: 10px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .control-item > span { grid-column: 1 / -1; }
    .btn-group { margin-top: 16px; }

    /* The personal seal has one long text field; let it use the full row. */
    body:has(#personalName) .control-group:first-of-type {
        grid-template-columns: 1fr;
    }
    body:has(#personalName) .control-group:first-of-type .control-item:not(:has(.radio-group)) {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
        align-items: start;
        row-gap: 6px;
    }

    /* The oval seal has four related geometry sliders; a four-column row keeps them together. */
    body:has(#ovalWidth) .control-group:nth-of-type(2),
    body:has(#ovalWidth) .control-group:nth-of-type(3) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 12px;
    }

    /* Personal seal: pair the related controls and keep ageing as a full-width row. */
    body.generator-personal .personal-pair-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
    }
    body.generator-personal .personal-single-row {
        grid-template-columns: 1fr;
    }

    /* Homepage: keep the reading order explicit instead of packing unrelated controls together. */
    body.generator-home .controls { padding-top: 24px; padding-bottom: 24px; }
    body.generator-home .control-group { grid-template-columns: 1fr; margin-top: 12px; }
    body.generator-home .control-group + .control-group { padding-top: 8px; }
    body.generator-home .home-input-stack { row-gap: 8px; }
    body.generator-home .home-input-stack .control-item,
    body.generator-home .home-pair-row .control-item,
    body.generator-home .home-single-row .control-item {
        grid-template-columns: 1fr;
        align-items: start;
        row-gap: 6px;
        padding: 7px 0;
    }
    body.generator-home .home-pair-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 20px;
    }
    body.generator-home .home-pair-row label {
        white-space: normal;
        font-size: 13px;
        letter-spacing: -.005em;
    }
    body.generator-home .btn-group { margin-top: 4px; }
}
@media (max-width: 680px) {
    .nav-inner, .header-content { padding: 0 16px; }
    .brand { font-size: 14px; }
    .product-nav { gap: 0; overflow-x: auto; scrollbar-width: none; }
    .product-nav::-webkit-scrollbar { display: none; }
    .product-nav a { min-height: 34px; padding: 0 9px; font-size: 12px; }
    .product-nav .network-tool-link { margin-left: 3px; }
    .page-hero { padding: 34px 16px 24px; }
    main { padding-left: 16px; padding-right: 16px; }
    .app-container { grid-template-columns: 1fr; border-radius: var(--r-card); }
    .preview-area { border-top: 1px solid var(--hairline); border-left: 0; }
    canvas { width: min(100%, 320px); }
    .mini-program-card { grid-template-columns: 1fr; justify-items: center; gap: 12px; width: min(100%, 320px); text-align: center; }
    .mini-program-card img { width: 180px; }
    .faq-item { grid-template-columns: 1fr; gap: 10px; }
    .banner-notice { align-items: flex-start; flex-direction: column; }
    .banner-notice > a { align-self: stretch; }
    footer { padding-left: 16px; padding-right: 16px; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; padding: 28px 0 22px; }
    .footer-nav { gap: 2px 16px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 14px; }
    .footer-author-link { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .2s !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
@media (prefers-reduced-transparency: reduce) { .site-nav, body > header { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; } .banner-notice-cta { background: rgba(255, 255, 255, .28); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-contrast: more) { .site-nav, body > header { border-bottom-color: rgba(0, 0, 0, .35); } input[type='text'], select, input[type='color'], .radio-item, .btn-sub { border-color: rgba(0, 0, 0, .35); } }
