#ns-seal-app {
    --ns-red: #b5342b;
    --ns-red-dark: #8f2821;
    --ns-bg: #faf8f5;
    --ns-card: #ffffff;
    --ns-border: #e2dcd4;
    --ns-text: #2b2520;
    --ns-muted: #8a7f74;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ns-text);
    display: flex;
    gap: 32px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 880px;
    margin: 0 auto;
    padding: 8px;
}
.ns-panel {
    flex: 1 1 280px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--ns-card);
    border: 1px solid var(--ns-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(43, 37, 32, 0.06);
}
.ns-row { display: flex; gap: 12px; }
.ns-row .ns-field { flex: 1; }
.ns-field { display: flex; flex-direction: column; gap: 7px; }
.ns-field label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--ns-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ns-field input[type="text"], .ns-field select {
    padding: 10px 12px;
    border: 1px solid var(--ns-border);
    border-radius: 9px;
    font-size: 15px;
    background: var(--ns-bg);
    color: var(--ns-text);
    transition: border-color 0.18s, box-shadow 0.18s;
    width: 100%;
    box-sizing: border-box;
}
.ns-field input[type="text"]:focus, .ns-field select:focus {
    outline: none;
    border-color: var(--ns-red);
    box-shadow: 0 0 0 3px rgba(181, 52, 43, 0.12);
}

/* 字体加载进度 */
.ns-font-progress {
    font-size: 11px;
    font-weight: 600;
    color: var(--ns-red);
    background: rgba(181, 52, 43, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 36px;
    text-align: center;
    transition: all 0.3s;
}
.ns-font-progress.done {
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.1);
}

/* Color Picker */
.ns-color-wrap {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--ns-border); border-radius: 9px;
    padding: 5px 10px; background: var(--ns-bg); position: relative;
}
.ns-color-wrap input[type="color"] {
    -webkit-appearance: none; border: none; width: 24px; height: 24px;
    padding: 0; background: none; cursor: pointer; flex-shrink: 0;
}
.ns-color-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.ns-color-wrap input[type="color"]::-webkit-color-swatch { border: 1px solid #ccc; border-radius: 4px; }
#ns-color-text { font-size: 13px; color: var(--ns-text); font-family: monospace; flex: 1; }
.ns-color-presets { display: flex; gap: 6px; }
.ns-preset {
    width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: transform 0.15s;
}
.ns-preset:hover { transform: scale(1.2); }

/* Range Slider + 数字输入 */
.ns-range-wrap { display: flex; align-items: center; gap: 10px; }
.ns-range-wrap input[type="range"] { flex: 1; -webkit-appearance: none; background: transparent; }
.ns-range-wrap input[type="range"]:focus { outline: none; }
.ns-range-wrap input[type="range"]::-webkit-slider-runnable-track {
    width: 100%; height: 6px; cursor: pointer; background: #e2dcd4; border-radius: 3px;
}
.ns-range-wrap input[type="range"]::-webkit-slider-thumb {
    height: 18px; width: 18px; border-radius: 50%; background: var(--ns-red);
    cursor: pointer; -webkit-appearance: none; margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.1s;
}
.ns-range-wrap input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.1); }
.ns-range-wrap input[type="number"] {
    width: 60px; padding: 6px 8px; border: 1px solid var(--ns-border);
    border-radius: 7px; font-size: 14px; text-align: center;
    background: var(--ns-bg); color: var(--ns-text);
}
.ns-range-wrap input[type="number"]:focus { outline: none; border-color: var(--ns-red); }

#ns-download {
    margin-top: 8px; padding: 12px 18px; background: var(--ns-red); color: #fff;
    border: none; border-radius: 9px; font-size: 15px; font-weight: 600;
    letter-spacing: 0.02em; cursor: pointer; transition: background 0.18s, transform 0.1s;
}
#ns-download:hover { background: var(--ns-red-dark); }
#ns-download:active { transform: scale(0.985); }

.ns-actions { display: flex; gap: 10px; margin-top: 4px; }
.ns-btn-outline {
    flex: 1; padding: 10px; background: transparent; border: 1px solid var(--ns-border);
    color: var(--ns-text); border-radius: 9px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.18s; text-align: center;
}
.ns-btn-outline:hover { background: var(--ns-bg); border-color: #ccc; }

.ns-preview-wrap { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#ns-canvas {
    display: block; width: 340px; height: 340px; border-radius: 18px;
    box-shadow: 0 8px 32px rgba(43, 37, 32, 0.1);
    border: 1px solid var(--ns-border);
}

/* Modal */
.ns-modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 999999; align-items: center; justify-content: center;
    padding: 20px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ns-modal.active { display: flex; }
.ns-modal-content {
    background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 480px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); display: flex; flex-direction: column; gap: 16px;
}
.ns-modal-content h3 { margin: 0; font-size: 18px; color: #2b2520; }
.ns-modal-desc { margin: 0; font-size: 13px; color: #8a7f74; }
#ns-modal-textarea {
    width: 100%; height: 160px; padding: 12px; border: 1px solid #e2dcd4;
    border-radius: 9px; font-family: monospace; font-size: 13px; background: #faf8f5;
    color: #2b2520; resize: none; box-sizing: border-box; line-height: 1.5;
}
#ns-modal-textarea:focus { outline: none; border-color: #b5342b; }
.ns-modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.ns-btn-primary {
    padding: 10px 20px; background: #b5342b; color: #fff; border: none;
    border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.ns-btn-primary:hover { background: #8f2821; }

@media (max-width: 680px) {
    #ns-seal-app { gap: 20px; padding: 0 8px; }
    .ns-panel { padding: 18px; }
    #ns-canvas { width: 280px; height: 280px; }
    .ns-color-wrap { flex-wrap: wrap; }
    .ns-color-presets { width: 100%; justify-content: space-between; }
    .ns-range-wrap { flex-wrap: wrap; }
    .ns-range-wrap input[type="number"] { width: 100%; }
}