/* ============================================================
   工具子页共享样式（/tool/* 各功能页通用骨架）
   主题变量来自 baseHeaderFooter.css，与 inspiration.html 视觉一致
   ============================================================ */
.tk-wrapper { max-width: 1400px; margin: 24px auto 48px; padding: 0 24px; }
.tk-wrapper .page-header { text-align: center; margin-bottom: 20px; }
.tk-wrapper h1 {
    font-family: var(--font-serif); font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700; color: var(--text); letter-spacing: 3px; margin-bottom: 6px;
}
.tk-wrapper h1 .accent { color: var(--primary); }
.tk-wrapper .page-sub { font-size: 14px; color: var(--text-light); letter-spacing: 1.5px; font-weight: 300; opacity: .8; }
.tk-wrapper .back-link {
    display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--text-light);
    text-decoration: none; letter-spacing: 1px; transition: var(--transition);
}
.tk-wrapper .back-link:hover { color: var(--primary-dark); }

.tk-main { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: flex-start; }
.tk-left { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 96px; }
.tk-right { display: flex; flex-direction: column; gap: 20px; }

.tk-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 18px 20px;
}
.tk-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tk-card-head h2 { font-family: var(--font-serif); font-size: 16px; color: var(--text); letter-spacing: 1px; }
.tk-card-head .icon { margin-right: 6px; }

.tk-label { font-size: 12px; color: var(--text-light); letter-spacing: 1px; margin: 14px 0 8px; }
.tk-hint { font-size: 11px; color: var(--text-light); opacity: .75; margin-top: 6px; line-height: 1.6; }

.tk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-chip {
    padding: 4px 12px; font-size: 12px; border-radius: 40px; cursor: pointer; user-select: none;
    border: 1.5px solid rgba(212, 133, 138, 0.22); color: var(--text-light); background: #fff;
    transition: var(--transition);
}
.tk-chip:hover { color: var(--primary-dark); border-color: rgba(212, 133, 138, 0.45); }
.tk-chip.active { color: #fff; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); border-color: transparent; }

input.tk-input, textarea.tk-input, select.tk-select {
    width: 100%; box-sizing: border-box; border: 1.5px solid rgba(212, 133, 138, 0.22); border-radius: 10px;
    padding: 9px 12px; font-size: 13px; line-height: 1.6; color: var(--text);
    background: #fff; outline: none; transition: var(--transition); font-family: var(--font-sans);
}
textarea.tk-input { min-height: 100px; resize: vertical; }
input.tk-input:focus, textarea.tk-input:focus, select.tk-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(212, 133, 138, 0.12); }

input[type="color"].tk-color { width: 44px; height: 30px; padding: 2px; border: 1.5px solid rgba(212,133,138,.22); border-radius: 8px; background: #fff; cursor: pointer; }

/* 上传区 */
.tk-zone {
    aspect-ratio: 3 / 4; border-radius: 12px; border: 1.5px dashed rgba(212,133,138,.45);
    background: var(--primary-pale); display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; overflow: hidden; transition: var(--transition);
}
.tk-zone:hover { border-color: var(--primary); }
.tk-zone.no-ratio { aspect-ratio: auto; min-height: 180px; }
.tk-zholder { text-align: center; color: var(--primary-dark); }
.tk-zholder .up-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.tk-zholder .up-text { font-size: 13px; font-weight: 600; letter-spacing: 1px; }
.tk-zholder .up-sub { font-size: 11px; opacity: .75; margin-top: 4px; }
.tk-zprev { position: absolute; inset: 0; }
.tk-zprev img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tk-zdel {
    position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
    background: rgba(0,0,0,.55); color: #fff; border: none; font-size: 14px; line-height: 26px; cursor: pointer; padding: 0;
}
/* 多图缩略行（拼图/图转PDF） */
.tk-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.tk-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1.5px solid rgba(212,133,138,.25); }
.tk-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-thumb .tk-zdel { width: 20px; height: 20px; line-height: 20px; font-size: 11px; top: 3px; right: 3px; }
.tk-addthumb {
    aspect-ratio: 1; border-radius: 8px; border: 1.5px dashed rgba(212,133,138,.45); background: var(--primary-pale);
    display: flex; align-items: center; justify-content: center; color: var(--primary-dark); font-size: 20px; cursor: pointer;
}

.tk-btn {
    width: 100%; margin-top: 18px; padding: 11px 0; border: none; border-radius: 40px; cursor: pointer;
    font-size: 14px; font-weight: 600; letter-spacing: 2px; color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 8px 22px rgba(212, 133, 138, 0.35); transition: var(--transition);
}
.tk-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(212, 133, 138, 0.42); }
.tk-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.tk-spinner {
    width: 30px; height: 30px; margin: 0 auto 10px; border-radius: 50%;
    border: 3px solid rgba(212,133,138,.25); border-top-color: var(--primary);
    animation: tkSpin 0.9s linear infinite;
}
@keyframes tkSpin { to { transform: rotate(360deg); } }
.tk-loading { text-align: center; color: var(--primary-dark); font-size: 12px; padding: 40px 0; }
.tk-empty { text-align: center; color: var(--text-light); padding: 40px 12px; }
.tk-empty .e-icon { font-size: 34px; display: block; margin-bottom: 10px; opacity: .6; }
.tk-fail { text-align: center; color: #b04a4a; padding: 40px 12px; font-size: 13px; }

/* 结果展示 */
.tk-result { min-height: 320px; display: flex; align-items: center; justify-content: center; }
.tk-result-img { text-align: center; width: 100%; }
.tk-result-img img { max-width: 50%; border-radius: 10px; display: block; margin: 0 auto; cursor: zoom-in; }
.tk-result-img .img-cap { font-size: 12px; color: var(--text-light); margin-top: 8px; letter-spacing: 1px; }
.tk-checker { background: repeating-conic-gradient(#ececec 0% 25%, #ffffff 0% 50%); background-size: 20px 20px; border-radius: 12px; overflow: hidden; display: inline-block; padding: 8px; }
.tk-actions { display: flex; justify-content: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.tk-dl {
    padding: 7px 26px; border-radius: 40px; cursor: pointer; font-size: 13px; letter-spacing: 1px;
    border: 1.5px solid rgba(212,133,138,.4); background: #fff; color: var(--primary-dark); transition: var(--transition);
}
.tk-dl:hover { background: var(--primary-pale); }
.tk-stats { text-align: center; font-size: 13px; color: var(--text); letter-spacing: 1px; margin-top: 12px; }
.tk-grid9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.tk-grid9 img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.tk-pre { background: #faf7f7; border-radius: 10px; padding: 12px; font-size: 11px; line-height: 1.25; overflow: auto; max-height: 40vh; white-space: pre; margin: 0 0 12px; }
.tk-info-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tk-info-table td { border-bottom: 1px solid rgba(212,133,138,.12); padding: 6px 8px; color: var(--text); vertical-align: top; }
.tk-info-table td:first-child { color: var(--text-light); white-space: nowrap; width: 40%; }
.tk-hexcircles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.tk-hexcircle { font-size: 11px; color: var(--text-light); text-align: center; cursor: pointer; }
.tk-hexcircle i { display: block; width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 4px; border: 1px solid rgba(0,0,0,.08); }

/* 图片放大浮层（与灵感页同款） */
.tk-lightbox {
    position: fixed; inset: 0; z-index: 3000; background: rgba(20, 10, 10, 0.88);
    display: none; align-items: center; justify-content: center;
}
.tk-lightbox.show { display: flex; }
.tk-lightbox img {
    max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5); user-select: auto; -webkit-touch-callout: default;
}
.tk-lightbox .lb-close {
    position: absolute; top: 18px; right: 22px; width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
    font-size: 18px; color: rgba(255,255,255,.85); background: rgba(255,255,255,.12);
}
.tk-lightbox .lb-close:hover { background: rgba(255,255,255,.28); color: #fff; }

@media (max-width: 1100px) { .tk-main { grid-template-columns: 340px 1fr; } }
@media (max-width: 992px) {
    .tk-main { grid-template-columns: 1fr; }
    .tk-left { position: static; }
}
@media (max-width: 480px) { .tk-wrapper { padding: 0 14px; } }
