/* ═══════════════════════════════════════
   AI 修图 (Photo Retouch) 样式
   与 web_mind.css 共用 CSS 变量
   ═══════════════════════════════════════ */

/* ── 首页功能总入口 Hub ── */
.hub-wrap {
    max-width: 1240px;
    margin: 26px auto 4px;
    padding: 0 20px;
}
.hub-head { margin-bottom: 16px; }
.hub-head h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hub-head h2 i { color: var(--primary); }
.hub-head p { font-size: 13px; color: var(--text-sub); margin: 0; }

.hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 900px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .hub-grid { grid-template-columns: 1fr; } }

.hub-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    cursor: pointer;
}
.hub-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #c7d2fe;
}
.hub-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99,102,241,.22);
}
.hub-body { flex: 1; min-width: 0; }
.hub-title {
    font-size: 15px; font-weight: 700; color: var(--text-main);
    display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
}
.hub-desc { font-size: 12.5px; color: var(--text-sub); line-height: 1.5; }
.hub-arrow { color: var(--text-light); font-size: 13px; transition: transform .22s; }
.hub-card:hover .hub-arrow { transform: translateX(3px); color: var(--primary); }

.hub-tag {
    font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 8px; line-height: 1.5;
}
.hub-tag.hot { background: linear-gradient(135deg,#ff4d4f,#ff7a45); color: #fff; }
.hub-tag.free { background: linear-gradient(135deg,#10b981,#059669); color: #fff; }

/* AI 修图大卡片（跨列） */
.hub-big {
    grid-column: span 3;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #eef2ff 100%);
    border: 1px solid #c7e0f7;
    cursor: default;
}
@media (max-width: 900px) { .hub-big { grid-column: span 2; } }
@media (max-width: 560px) { .hub-big { grid-column: span 1; } }
.hub-big-head { display: flex; align-items: center; gap: 14px; }
.hub-new-badge {
    position: absolute; top: -9px; right: 16px;
    background: linear-gradient(135deg,#06b6d4,#3b82f6);
    color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .8px;
    padding: 3px 10px; border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(59,130,246,.35);
}
.hub-tools {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 900px) { .hub-tools { grid-template-columns: repeat(2, 1fr); } }

.hub-tool {
    position: relative;
    display: flex; align-items: center; gap: 8px;
    padding: 11px 12px;
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 13px; font-weight: 600;
    transition: all .2s ease;
}
.hub-tool:hover {
    border-color: #38bdf8;
    background: #f8fbff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(56,189,248,.18);
    color: #0369a1;
}
.hub-tool i { color: #0ea5e9; font-size: 14px; flex-shrink: 0; }
.hub-tool-hot {
    position: absolute; top: -7px; right: 6px;
    font-size: 8px; font-style: normal; font-weight: 800;
    background: linear-gradient(135deg,#ff4d4f,#ff7a45);
    color: #fff; padding: 1px 5px; border-radius: 6px;
}

/* tabs 里的外链 tab */
.mode-tab-link { text-decoration: none; position: relative; }
.mode-tab-link:hover { background: #e0f2fe; color: #0284c7; border-color: #7dd3fc; }

/* ═══════════════════════════════════════
   修图页布局（导航 + 左侧栏 + 主工作台）
   ═══════════════════════════════════════ */
.rt-layout {
    max-width: 1400px;
    margin: 22px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 216px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 980px) {
    .rt-layout { grid-template-columns: 1fr; }
    .rt-side { position: static !important; }
    .rt-side-list { display: grid !important; grid-template-columns: repeat(2, 1fr); }
}

/* 左侧工具导航 */
.rt-side {
    position: sticky;
    top: 84px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 14px 12px;
}
.rt-side-title {
    font-size: 12px; font-weight: 700; color: var(--text-light);
    letter-spacing: 1px; text-transform: uppercase;
    padding: 0 8px 10px;
    display: flex; align-items: center; gap: 6px;
}
.rt-side-group { margin-bottom: 12px; }
.rt-side-group h4 {
    font-size: 11px; color: var(--text-light); font-weight: 700;
    margin: 0 0 6px; padding-left: 8px; letter-spacing: .5px;
}
.rt-side-list { display: flex; flex-direction: column; gap: 3px; }
.rt-side-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 13.5px; font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    border: none; background: none; width: 100%; text-align: left;
    transition: all .18s ease;
    position: relative;
}
.rt-side-item i { width: 16px; text-align: center; font-size: 13px; color: #94a3b8; }
.rt-side-item:hover { background: #f1f5f9; color: var(--text-main); }
.rt-side-item:hover i { color: #0284c7; }
.rt-side-item.active {
    background: linear-gradient(135deg,#e0f2fe,#eef2ff);
    color: #0369a1;
    box-shadow: inset 0 0 0 1px #bae6fd;
}
.rt-side-item.active i { color: #0284c7; }
.rt-side-item .rt-hot {
    margin-left: auto; font-size: 8px; font-weight: 800;
    background: linear-gradient(135deg,#ff4d4f,#ff7a45);
    color: #fff; padding: 1px 5px; border-radius: 6px;
}

/* 主工作台 */
.rt-main {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 22px;
    min-height: 560px;
}
.rt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.rt-head-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    background: linear-gradient(135deg,#06b6d4,#3b82f6);
    box-shadow: 0 4px 14px rgba(59,130,246,.25);
    flex-shrink: 0;
}
.rt-head h2 { font-size: 18px; font-weight: 700; margin: 0; color: var(--text-main); }
.rt-head p { font-size: 13px; color: var(--text-sub); margin: 2px 0 0; }

.rt-body {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    margin-top: 18px;
}
@media (max-width: 1150px) { .rt-body { grid-template-columns: 1fr; } }

/* 上传区 */
.rt-drop {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    background: #fafbfc;
    min-height: 260px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px;
    cursor: pointer;
    padding: 20px;
    transition: all .22s ease;
    position: relative;
    overflow: hidden;
}
.rt-drop:hover, .rt-drop.dragover { border-color: #38bdf8; background: #f0f9ff; }
.rt-drop i.rt-drop-icon { font-size: 34px; color: #94a3b8; }
.rt-drop strong { font-size: 14px; color: var(--text-main); font-weight: 600; }
.rt-drop span { font-size: 12px; color: var(--text-light); }
.rt-drop img.rt-preview {
    max-width: 100%; max-height: 320px;
    border-radius: 10px; object-fit: contain;
    box-shadow: var(--shadow-md);
}
.rt-drop .rt-replace {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(15,23,42,.72); color: #fff;
    font-size: 11px; padding: 5px 10px; border-radius: 8px;
    backdrop-filter: blur(4px);
}

/* 参数区 */
.rt-form { display: flex; flex-direction: column; gap: 14px; }
.rt-field label {
    font-size: 13px; font-weight: 600; color: var(--text-main);
    display: block; margin-bottom: 6px;
}
.rt-field textarea, .rt-field input[type=text] {
    width: 100%; padding: 11px 13px; font-size: 14px;
    border: 1.5px solid var(--border); border-radius: 10px;
    font-family: inherit; resize: vertical; line-height: 1.6;
    background: #fafbfc; transition: all .2s;
}
.rt-field textarea { min-height: 86px; }
.rt-field textarea:focus, .rt-field input[type=text]:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-glow); background: #fff;
}
.rt-field select {
    width: 100%; padding: 9px 12px; font-size: 13.5px;
    border: 1.5px solid var(--border); border-radius: 10px;
    background: #fafbfc; font-family: inherit;
}
.rt-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-chip {
    font-size: 12px; padding: 6px 12px; border-radius: 20px;
    border: 1.5px solid var(--border); background: #fff;
    cursor: pointer; color: var(--text-sub); font-weight: 500;
    transition: all .18s;
}
.rt-chip:hover { border-color: #7dd3fc; color: #0284c7; }
.rt-chip.active {
    background: linear-gradient(135deg,#e0f2fe,#eef2ff);
    border-color: #38bdf8; color: #0369a1; font-weight: 700;
}

/* ── 场景参数（证件照 / 商品图 / 个人写真）── */
.rt-opt-hint {
    font-size: 12px; line-height: 1.6; color: #b45309;
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 8px; padding: 8px 10px; margin-bottom: 12px;
}
.rt-opt-group { margin-bottom: 14px; }
.rt-opt-select {
    width: 100%; padding: 9px 10px; font-size: 13px;
    border: 1.5px solid var(--border); border-radius: 8px;
    background: #fff; color: var(--text-main); cursor: pointer;
}
.rt-opt-select:focus { outline: none; border-color: #38bdf8; }

/* 颜色块 */
.rt-color-chip { display: inline-flex; align-items: center; gap: 6px; }
.rt-color-chip i {
    width: 14px; height: 14px; border-radius: 50%;
    display: inline-block; border: 1px solid rgba(0,0,0,.12);
}

/* 风格卡片 */
.rt-opt-cards {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.rt-opt-card {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border: 1.5px solid var(--border); border-radius: 10px;
    background: #fff; cursor: pointer; font-size: 12px;
    color: var(--text-sub); font-weight: 500; transition: all .18s;
    text-align: center;
}
.rt-opt-card:hover { border-color: #7dd3fc; }
.rt-opt-card.active {
    background: linear-gradient(135deg,#e0f2fe,#eef2ff);
    border-color: #38bdf8; color: #0369a1; font-weight: 700;
}
.rt-opt-emoji { font-size: 20px; line-height: 1; }

/* 开关 */
.rt-toggle {
    display: inline-flex; border: 1.5px solid var(--border);
    border-radius: 8px; overflow: hidden; background: #fff;
}
.rt-toggle-opt {
    padding: 6px 18px; font-size: 12.5px; cursor: pointer;
    color: var(--text-sub); font-weight: 500; transition: all .18s;
}
.rt-toggle-opt.active {
    background: linear-gradient(135deg,#e0f2fe,#eef2ff);
    color: #0369a1; font-weight: 700;
}

@media (max-width: 640px) {
    .rt-opt-cards { grid-template-columns: repeat(2, 1fr); }
}

.rt-submit {
    width: 100%; margin-top: 4px; padding: 14px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff; border: none; border-radius: var(--radius-md);
    font-size: 15.5px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .25s;
    box-shadow: 0 6px 20px rgba(14,165,233,.25);
}
.rt-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(14,165,233,.35); }
.rt-submit:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.rt-cost {
    font-size: 12px; background: rgba(255,255,255,.22);
    padding: 2px 8px; border-radius: 6px; font-weight: 600;
}

/* 结果区 */
.rt-result {
    background: linear-gradient(135deg,#fafbfc,#f1f4f9);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 400px;
    display: flex; align-items: center; justify-content: center;
    padding: 14px;
    position: relative;
    overflow: hidden;
}
.rt-result img {
    max-width: 100%; max-height: 620px;
    border-radius: 8px; cursor: zoom-in;
    box-shadow: var(--shadow-md);
    animation: fadeInImage .45s ease;
}
.rt-result .rt-placeholder {
    text-align: center; color: var(--text-light); font-size: 13px;
}
.rt-result .rt-placeholder i { font-size: 38px; display: block; margin-bottom: 12px; color: #cbd5e1; }

.rt-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.rt-compare figure { margin: 0; text-align: center; }
.rt-compare figcaption { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; font-weight: 600; }
.rt-compare img { max-width: 100%; max-height: 460px; border-radius: 8px; }

/* 进度 */
.rt-progress { width: 100%; max-width: 360px; text-align: center; }
.rt-progress .rt-bar {
    height: 8px; background: #e2e8f0; border-radius: 6px; overflow: hidden; margin-bottom: 10px;
}
.rt-progress .rt-bar div {
    height: 100%; width: 0;
    background: linear-gradient(90deg,#0ea5e9,#6366f1);
    border-radius: 6px; transition: width .5s;
}
.rt-progress p { font-size: 13px; color: var(--text-sub); margin: 0; }

/* 行动按钮 */
.rt-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rt-actions button, .rt-actions a {
    font-size: 12.5px; padding: 8px 14px; border-radius: 9px;
    border: 1px solid var(--border); background: #fff; color: var(--text-sub);
    cursor: pointer; text-decoration: none; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .2s;
}
.rt-actions button:hover, .rt-actions a:hover {
    border-color: var(--primary-light); color: var(--primary); background: #f8faff;
}

/* 画笔画布（局部重绘） */
.rt-mask-wrap { position: relative; display: inline-block; max-width: 100%; }
.rt-mask-wrap canvas { position: absolute; left: 0; top: 0; cursor: crosshair; }
.rt-mask-tools { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-sub); flex-wrap: wrap; }
.rt-mask-tools input[type=range] { width: 110px; }
.rt-mask-tools button {
    font-size: 12px; padding: 6px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: #fff; cursor: pointer;
}
