/* ==========================================================================
   36. 艺术签名设计 · signature-design
   风格：练字纸 + 靛青墨迹 / 手写练习本
   ========================================================================== */

.tsk.sig {
    --sig-paper: #f7f5ef;
    --sig-paper-2: #efebe1;
    --sig-ink: #22211f;
    --sig-ink-2: #57534c;
    --sig-mute: #8b857a;
    --sig-accent: #2b5d8a;
    --sig-accent-2: #4b83b3;
    --sig-accent-soft: #e4edf5;
    --sig-line: #ded8ca;
    --sig-card: #fffdf9;
    --sig-shadow: 0 18px 38px rgba(40, 45, 55, .1);
    --tsk-brand: #2b5d8a;
    color: var(--sig-ink);
}

.sig .tsk-h1 b { color: var(--sig-accent); }
.sig .tsk-kicker i { background: var(--sig-accent); }

/* ---------- 首屏 ---------- */
.sig-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
    gap: 34px;
    align-items: stretch;
    padding: 30px 0 10px;
}

.sig-hero-l {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.sig-hero-l .tsk-lead { max-width: 640px; }
.sig-hero-r { display: flex; min-width: 0; }

/* ---------- 表单 ---------- */
.sig-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sig-line);
    border-radius: 18px;
    background: var(--sig-card);
    box-shadow: var(--sig-shadow);
    overflow: hidden;
}

.sig-form-hd {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--sig-line);
    background:
        repeating-linear-gradient(180deg, transparent 0 23px, rgba(43, 93, 138, .09) 23px 24px),
        var(--sig-paper-2);
}

.sig-form-hd b { font-size: 14.5px; }
.sig-form-hd small { font-size: 12px; color: var(--sig-mute); }

.sig-form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 18px 20px 20px;
}

.sig-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sig-row3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sig-err {
    display: block;
    min-height: 15px;
    margin-top: 3px;
    font-size: 12px;
    color: #c0261b;
}

.tsk-input.is-error { border-color: #c0261b; box-shadow: 0 0 0 3px rgba(192, 38, 27, .12); }

/* 风格切换 */
.sig-styles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-top: 6px;
}

.sig-style {
    padding: 8px 4px;
    border: 1px solid var(--sig-line);
    border-radius: 9px;
    background: #fff;
    color: var(--sig-ink-2);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .16s, background .16s, color .16s, transform .16s;
}

.sig-style:hover { transform: translateY(-1px); border-color: #b9cfdf; }

.sig-style.is-on {
    border-color: var(--sig-accent);
    background: var(--sig-accent-soft);
    color: var(--sig-accent);
    font-weight: 700;
}

/* 滑杆 */
.sig-range {
    width: 100%;
    height: 5px;
    margin-top: 10px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--sig-accent), #bcd2e3);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.sig-range::-webkit-slider-thumb {
    width: 17px;
    height: 17px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--sig-accent);
    box-shadow: 0 2px 7px rgba(43, 93, 138, .35);
    cursor: pointer;
    -webkit-appearance: none;
}

.sig-range::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--sig-accent);
    cursor: pointer;
}

.sig-val {
    float: right;
    font-size: 12px;
    font-weight: 700;
    color: var(--sig-accent);
    font-variant-numeric: tabular-nums;
}

/* 颜色 */
.sig-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 6px;
}

.sig-swatch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px 4px 5px;
    border: 1px solid var(--sig-line);
    border-radius: 99px;
    background: #fff;
    color: var(--sig-ink-2);
    font-size: 11.5px;
    cursor: pointer;
    transition: border-color .16s, box-shadow .16s;
}

.sig-swatch i {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--sig-c);
}

.sig-swatch.is-on {
    border-color: var(--sig-c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sig-c) 16%, transparent);
    color: var(--sig-ink);
}

/* 开关 */
.sig-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 2px 0;
}

.sig-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--sig-ink-2);
}

.sig-switch input { position: absolute; opacity: 0; pointer-events: none; }

.sig-switch-ui {
    position: relative;
    width: 33px;
    height: 19px;
    border-radius: 99px;
    background: #dcd6c8;
    transition: background .18s;
}

.sig-switch-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .18s;
}

.sig-switch input:checked + .sig-switch-ui { background: var(--sig-accent); }
.sig-switch input:checked + .sig-switch-ui::after { transform: translateX(14px); }
.sig-switch input:focus-visible + .sig-switch-ui { outline: 2px solid var(--sig-accent); outline-offset: 2px; }

.sig-acts { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 4px; }

.sig-tip {
    margin: 0;
    padding-top: 8px;
    border-top: 1px dashed var(--sig-line);
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--sig-mute);
}

/* ---------- 工作台 ---------- */
.sig-work {
    margin-top: 26px;
    border: 1px solid var(--sig-line);
    border-radius: 20px;
    background: var(--sig-card);
    box-shadow: var(--sig-shadow);
    overflow: hidden;
}

.sig-work-hd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--sig-line);
    background: var(--sig-paper-2);
}

.sig-work-sub { margin: 4px 0 0; font-size: 12px; color: var(--sig-mute); }

.sig-tools { display: flex; flex-wrap: wrap; gap: 8px; }

.sig-work-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 24px;
    padding: 24px;
    align-items: start;
}

.sig-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sig-stage-inner {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--sig-line);
    border-radius: 16px;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #ececec 25%, transparent 25%),
        linear-gradient(-45deg, #ececec 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ececec 75%),
        linear-gradient(-45deg, transparent 75%, #ececec 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.sig-stage-inner canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
}

.sig-stage-note { margin: 0; font-size: 11.5px; color: var(--sig-mute); }

.sig-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sig-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--sig-line);
    border-radius: 12px;
    background: var(--sig-paper);
}

.sig-stat b { font-size: 17px; letter-spacing: -.01em; }
.sig-stat span { font-size: 12px; color: var(--sig-mute); }

.sig-side-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.sig-side-list li {
    display: flex;
    gap: 9px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--sig-ink-2);
}

.sig-side-list li i {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-top: 8px;
    border-radius: 50%;
    background: var(--sig-accent);
}

/* ---------- 区块标题 ---------- */
.sig-sec-sub { font-size: 12px; color: var(--sig-mute); }

/* ---------- 风格卡 ---------- */
.sig-styles-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.sig-card {
    padding: 20px 18px 18px;
    border: 1px solid var(--sig-line);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(43, 93, 138, .04), transparent 40%),
        var(--sig-card);
    transition: transform .18s, box-shadow .18s;
}

.sig-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 26px rgba(40, 50, 65, .1);
}

.sig-card-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-bottom: 12px;
    border: 1px solid var(--sig-accent);
    border-radius: 50%;
    color: var(--sig-accent);
    font-size: 12px;
    font-weight: 700;
}

.sig-card b { display: block; font-size: 15px; margin-bottom: 8px; }
.sig-card p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.75; color: var(--sig-ink-2); }

.sig-card small {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 99px;
    background: var(--sig-paper-2);
    color: var(--sig-mute);
    font-size: 11.5px;
}

/* ---------- 场景 ---------- */
.sig-scenes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.sig-scene {
    padding: 22px 20px;
    border: 1px solid var(--sig-line);
    border-radius: 14px;
    background: var(--sig-card);
}

.sig-scene > span { display: block; font-size: 24px; margin-bottom: 10px; }
.sig-scene b { display: block; font-size: 14px; margin-bottom: 7px; }
.sig-scene p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--sig-ink-2); }

/* ---------- 自查 ---------- */
.sig-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.sig-check {
    display: flex;
    gap: 14px;
    padding: 17px 18px;
    border: 1px solid var(--sig-line);
    border-radius: 14px;
    background: var(--sig-card);
}

.sig-check > span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sig-accent-soft);
    color: var(--sig-accent);
    font-size: 12px;
    font-weight: 700;
}

.sig-check b { display: block; font-size: 13.5px; margin-bottom: 5px; }
.sig-check p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--sig-ink-2); }

/* ---------- Toast ---------- */
.sig-toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    z-index: 999;
    padding: 11px 18px;
    border-radius: 99px;
    background: rgba(30, 34, 40, .92);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    transform: translate(-50%, 14px);
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.sig-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .sig-hero { grid-template-columns: minmax(0, 1fr); }
    .sig-styles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sig-work-body { grid-template-columns: minmax(0, 1fr); }
    .sig-side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sig-side-list { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .sig-row2, .sig-row3 { grid-template-columns: 1fr; }
    .sig-styles-grid, .sig-scenes, .sig-checks { grid-template-columns: minmax(0, 1fr); }
    .sig-form-body, .sig-work-body { padding: 16px; }
    .sig-work-hd { padding: 14px 16px; }
    .sig-tools { width: 100%; }
    .sig-tools .tsk-btn { flex: 1 1 calc(50% - 8px); }
    .sig-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 深色模式（仅变量覆盖） ---------- */
:root[data-theme="dark"] .tsk.sig {
    --sig-paper: #1a1917;
    --sig-paper-2: #221f1b;
    --sig-ink: #f1ede4;
    --sig-ink-2: #c0bab0;
    --sig-mute: #8f887d;
    --sig-accent: #7fb0dd;
    --sig-accent-2: #a8cbea;
    --sig-accent-soft: #1c2b38;
    --sig-line: #332f28;
    --sig-card: #1e1c18;
    --sig-shadow: 0 18px 38px rgba(0, 0, 0, .45);
}

:root[data-theme="dark"] .tsk.sig .sig-style { background: #26221d; }
:root[data-theme="dark"] .tsk.sig .sig-swatch { background: #26221d; }
:root[data-theme="dark"] .tsk.sig .sig-switch-ui { background: #453e34; }
:root[data-theme="dark"] .tsk.sig .sig-stage-inner { background-color: #f7f5ef; }
:root[data-theme="dark"] .tsk.sig .sig-toast { background: rgba(255, 255, 255, .94); color: #1c1a16; }
