/* 网址整页截屏 /tools/webshot —— 三端适配 + 深浅色主题 */
body.page-webshot-full .app { max-width: 100%; }
body.page-webshot-full .main-content { max-width: 100%; border-right: 0; }
body.page-webshot-full .page-container { max-width: 100%; }

.ws {
    --ws-card: var(--bg-secondary, #16191d);
    --ws-card-2: color-mix(in srgb, var(--text-primary, #e6e9ef) 6%, transparent);
    --ws-line: var(--border-color, #2b3138);
    --ws-line-2: color-mix(in srgb, var(--text-primary, #e6e9ef) 18%, transparent);
    --ws-fg: var(--text-primary, #e6e9ef);
    --ws-fg-2: var(--text-secondary, #8b949e);
    max-width: 100%;
    margin: 0 auto;
    padding: 22px 20px 72px;
    box-sizing: border-box;
    color: var(--ws-fg);
}
[data-theme="light"] .ws {
    --ws-card: #ffffff;
    --ws-line: #e3e6ea;
    --ws-line-2: rgba(15, 20, 25, .16);
    --ws-fg: #1c2126;
    --ws-fg-2: #616b76;
}

/* ---------------- hero ---------------- */
.ws-hero { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.ws-hero-ico {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
    display: grid; place-items: center; font-size: 26px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #136ce9) 22%, transparent), color-mix(in srgb, var(--accent, #136ce9) 8%, transparent));
    border: 1px solid var(--ws-line);
}
.ws-title { margin: 2px 0 6px; font-size: 24px; line-height: 1.25; }
.ws-sub { margin: 0; color: var(--ws-fg-2); font-size: 14px; line-height: 1.65; max-width: 62em; }

/* ---------------- 通用件 ---------------- */
.ws-note {
    margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px;
    background: var(--ws-card); border: 1px solid var(--ws-line); color: var(--ws-fg-2);
}
.ws-note[hidden] { display: none !important; }
.ws-note.is-err { border-color: color-mix(in srgb, #f4212e 55%, transparent); color: #f4212e; }
.ws-note.is-ok { border-color: color-mix(in srgb, #2ea043 55%, transparent); color: #2ea043; }

.ws-card {
    background: var(--ws-card); border: 1px solid var(--ws-line); border-radius: 14px;
    padding: 16px 18px; margin-bottom: 16px;
}
.ws-card[hidden] { display: none !important; }
.ws-card-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ws-card-h h2 { margin: 0; font-size: 15.5px; font-weight: 600; }
.ws-card-hint { font-size: 12.5px; color: var(--ws-fg-2); }

.ws-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 16px; border-radius: 10px; font-size: 14px; cursor: pointer;
    border: 1px solid var(--ws-line-2); background: var(--ws-card-2); color: var(--ws-fg);
    transition: background .15s, border-color .15s, opacity .15s;
}
.ws-btn:hover { border-color: var(--accent, #136ce9); }
.ws-btn:disabled { opacity: .55; cursor: not-allowed; }
.ws-btn.primary { background: var(--accent, #136ce9); border-color: var(--accent, #136ce9); color: #fff; }
.ws-btn.primary:hover { filter: brightness(1.06); }
.ws-btn.ghost { background: transparent; }
.ws-btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

.ws-select, .ws-input {
    height: 38px; padding: 0 10px; border-radius: 10px; font-size: 14px;
    border: 1px solid var(--ws-line-2); background: var(--ws-card-2); color: var(--ws-fg);
    box-sizing: border-box; width: 100%;
}
.ws-select:focus, .ws-input:focus { outline: none; border-color: var(--accent, #136ce9); }
.ws-spacer { flex: 1 1 auto; }

/* ---------------- 输入区 ---------------- */
.ws-urls {
    width: 100%; box-sizing: border-box; resize: vertical; min-height: 92px;
    padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    border: 1px solid var(--ws-line-2); background: var(--ws-card-2); color: var(--ws-fg);
}
.ws-urls:focus { outline: none; border-color: var(--accent, #136ce9); }
.ws-urls-foot { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

/* ---------------- 选项 ---------------- */
.ws-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; }
.ws-opt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ws-opt > label { font-size: 12.5px; color: var(--ws-fg-2); }
.ws-opt[hidden] { display: none !important; }
.ws-opt-val { font-size: 12.5px; color: var(--ws-fg-2); }
.ws-opt input[type="range"] { width: 100%; accent-color: var(--accent, #136ce9); }
.ws-opt-check { justify-content: flex-end; }
.ws-opt-check label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ws-fg); cursor: pointer; }
.ws-opt-check input { width: 16px; height: 16px; accent-color: var(--accent, #136ce9); }
.ws-tip { margin: 12px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--ws-fg-2); }

/* ---------------- 舞台 ---------------- */
.ws-stage {
    position: relative; overflow: hidden; border-radius: 12px;
    background: #fff; border: 1px solid var(--ws-line); height: 520px;
    contain: layout paint;   /* iframe 内部重排不要波及整页 */
}
.ws-frame {
    display: block; width: 1440px; height: 900px; border: 0; background: #fff;
    transform-origin: top left; transform: scale(1);
}

/* 真机渲染：临时把渲染舞台铺满整个视口，画面里只剩目标网页
   （悬浮元素、进度条、卡片标题都要藏掉，否则会被一起拍进去） */
body.ws-realcap { overflow: hidden !important; }
body.ws-realcap #wsStageCard {
    position: fixed !important; left: 0; top: 0; right: 0; bottom: 0;
    z-index: 2147483000; margin: 0; padding: 0; border: 0; border-radius: 0;
    background: #fff; overflow: hidden;
}
body.ws-realcap #wsStageCard .ws-card-h { display: none !important; }
body.ws-realcap #wsProg { display: none !important; }
body.ws-realcap #wsStage {
    padding: 0 !important; height: 100vh; border: 0; border-radius: 0;
    overflow: hidden; background: #fff; contain: none;
}
body.ws-realcap .ws-frame { border: 0 !important; display: block; }

.ws-prog { margin-top: 12px; }
.ws-prog[hidden] { display: none !important; }
.ws-prog-bar { height: 6px; border-radius: 999px; background: var(--ws-card-2); overflow: hidden; }
.ws-prog-bar > i { display: block; height: 100%; width: 0; background: var(--accent, #136ce9); transition: width .25s; }
.ws-prog-t { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ws-fg-2); word-break: break-all; }

/* ---------------- 结果 ---------------- */
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ws-item {
    border: 1px solid var(--ws-line); border-radius: 12px; overflow: hidden;
    background: var(--ws-card-2); display: flex; flex-direction: column;
    contain: layout style;   /* 结果卡片多时减少整页重排 */
}
.ws-item.is-err { border-color: color-mix(in srgb, #f4212e 50%, transparent); }
.ws-item-img {
    display: block; width: 100%; height: 190px; object-fit: cover; object-position: top center;
    background: #f2f4f7; border-bottom: 1px solid var(--ws-line); cursor: zoom-in;
}
.ws-item-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ws-item-url { font-size: 12.5px; color: var(--ws-fg-2); word-break: break-all; line-height: 1.5; }
.ws-item-meta { font-size: 12px; color: var(--ws-fg-2); }
.ws-item-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.ws-item-err { font-size: 12.5px; color: #f4212e; line-height: 1.55; }
.ws-result-foot { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------------- 未登录 ---------------- */
.ws-lock {
    background: var(--ws-card); border: 1px solid var(--ws-line); border-radius: 14px;
    padding: 34px 20px; text-align: center;
}
.ws-lock-ico { font-size: 40px; }
.ws-lock h2 { margin: 10px 0 8px; font-size: 18px; }
.ws-lock p { margin: 0 auto 16px; max-width: 44em; color: var(--ws-fg-2); font-size: 14px; line-height: 1.7; }
.ws-lock .ws-btn { text-decoration: none; }

/* ---------------- 说明 ---------------- */
.ws-help {
    background: var(--ws-card); border: 1px solid var(--ws-line); border-radius: 14px;
    padding: 0 18px; overflow: hidden;
}
.ws-help-t {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    height: 44px; cursor: pointer; font-size: 14.5px; font-weight: 600; list-style: none;
}
.ws-help-t::-webkit-details-marker { display: none; }
.ws-help-t::marker { content: ''; }
.ws-help-caret { display: inline-flex; transition: transform .2s; color: var(--ws-fg-2); }
.ws-help[open] .ws-help-caret { transform: rotate(180deg); }
.ws-help-body { padding: 0 0 18px; font-size: 13.5px; line-height: 1.8; color: var(--ws-fg-2); }
.ws-help-body ol { margin: 0; padding-left: 20px; }
.ws-help-body li { margin-bottom: 6px; }
.ws-help-note { margin: 10px 0 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1099px) {
    .ws-stage { height: 420px; }
}
@media (max-width: 767px) {
    .ws { padding: 16px 14px 60px; }
    .ws-hero { gap: 12px; }
    .ws-hero-ico { width: 44px; height: 44px; font-size: 22px; }
    .ws-title { font-size: 20px; }
    .ws-card { padding: 14px; }
    .ws-opts { grid-template-columns: 1fr 1fr; }
    .ws-urls-foot .ws-btn { flex: 1 1 46%; }
    .ws-stage { height: 340px; }
    .ws-grid { grid-template-columns: 1fr; }
    .ws-item-img { height: 220px; }
    /* 手机端 16px 防 iOS 聚焦缩放 */
    .ws-urls, .ws-input, .ws-select { font-size: 16px; }
}
@media (max-width: 420px) {
    .ws-opts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .ws, .ws * { transition: none !important; }
}
