/**
 * 网站快照预览 - 样式
 *
 * 设备样式基于 picturepan2/devices.css (MIT License)
 * iPhone 14 Pro / iPad Pro / MacBook Pro / Pro Display XDR
 *
 * 【子主题统一 UI 规范】本文件分两段：
 *   第 1 段「页面 UI」—— 走主题 CSS 变量，与其它页面/组件统一；
 *   第 2 段「设备外观 (vendored)」—— devices.css 原样保留，
 *        里面的 #010101 / #0d0d0d 等是**设备物理颜色**（手机边框就是黑的），
 *        不属于配色不统一，**不要改成主题变量**，否则设备外观会失真。
 *   统一规格：主按钮 var(--theme-color) + var(--color-link-hover)、
 *            输入框 var(--bg-card) + var(--border-input) + var(--border-radius-sm)、
 *            正文 var(--text-primary) / 次要 var(--text-muted)
 */

/* ============================================================
   Part 1 — 页面 UI（走主题变量）
   ============================================================ */
.websnapshot-page {
    margin: 0;
    padding: 0;
    background: var(--bg-body);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.ws-url {
    text-align: center;
    padding: 30px 20px 10px;
}

.ws-url__inner {
    max-width: 720px;
    margin: 0 auto;
}

.ws-url__title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
    line-height: 1.35;
}

.ws-url__desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 20px;
    line-height: 1.7;
}

.ws-url__form {
    display: flex;
    gap: 8px;
    justify-content: center;
    max-width: 640px;
    margin: 0 auto;
}

.ws-url__input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-input);
    border-radius: var(--border-radius-sm);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    box-sizing: border-box;
}

.ws-url__input::placeholder {
    color: var(--text-muted);
}

.ws-url__input:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-color) 18%, transparent);
}

.ws-url__btn {
    width: 64px;
    height: 44px;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    background: var(--theme-color);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background-color 0.25s;
}

.ws-url__btn:hover {
    background: var(--color-link-hover);
}

.ws-wrapper {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.ws-display {
    position: relative;
    left: 0;
    height: 600px;
}

/* ============================================================
   Part 2 — 设备外观 (vendored from devices.css, MIT)
   注意：以下 #010101 / #0d0d0d / #1b1721 等为设备物理配色，勿改为主题变量
   ============================================================ */
.ws-device {
    position: absolute;
    overflow: hidden;
}

.ws-device__inner {
    position: relative;
}

.ws-device iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    display: block;
}

.ws-device .device-screen {
    overflow: hidden;
    position: relative;
    background: #fff;
}

/* ============================================================
   Devices.css — Global (MIT License)
   ============================================================ */
.device,
.device::before,
.device::after,
.device *,
.device *::before,
.device *::after {
  box-sizing: border-box;
  display: block;
}

/* ============================================================
   Device: iPhone 14 Pro
   ============================================================ */
.ws-device--mobile {
    width: 95px;
    height: 196px;
    top: 375px;
    left: 300px;
    z-index: 5;
}

.device-iphone-14-pro {
  height: 868px;
  width: 428px;
}

.device-iphone-14-pro .device-frame {
  background: #010101;
  border: 1px solid #1b1721;
  border-radius: 68px;
  box-shadow: inset 0 0 4px 2px #c0b7cd, inset 0 0 0 6px #342c3f;
  height: 868px;
  padding: 19px;
  position: relative;
  width: 428px;
}

.device-iphone-14-pro .device-screen {
  border-radius: 49px;
  height: 830px;
  width: 390px;
}

.device-iphone-14-pro .device-stripe::after,
.device-iphone-14-pro .device-stripe::before {
  border: solid rgba(1, 1, 1, .25);
  border-width: 0 7px;
  content: "";
  height: 7px;
  left: 0;
  position: absolute;
  width: 100%;
  z-index: 9;
}

.device-iphone-14-pro .device-stripe::after { top: 85px; }
.device-iphone-14-pro .device-stripe::before { bottom: 85px; }

.device-iphone-14-pro .device-header {
  background: #010101;
  border-radius: 20px;
  height: 35px;
  left: 50%;
  margin-left: -60px;
  position: absolute;
  top: 29px;
  width: 120px;
}

.device-iphone-14-pro .device-sensors::after,
.device-iphone-14-pro .device-sensors::before {
  content: "";
  position: absolute;
}

.device-iphone-14-pro .device-sensors::after {
  background: #010101;
  border-radius: 17px;
  height: 33px;
  left: 50%;
  margin-left: -37px;
  top: 30px;
  width: 74px;
}

.device-iphone-14-pro .device-sensors::before {
  background: radial-gradient(farthest-corner at 20% 20%, #6074bf 0, transparent 40%), radial-gradient(farthest-corner at 80% 80%, #513785 0, #24555e 20%, transparent 50%);
  border-radius: 50%;
  box-shadow: 0 0 1px 1px rgba(255, 255, 255, .05);
  height: 9px;
  left: 50%;
  margin-left: 36px;
  top: 42px;
  width: 9px;
}

.device-iphone-14-pro .device-btns {
  background: #1b1721;
  border-radius: 2px;
  height: 32px;
  left: -2px;
  position: absolute;
  top: 115px;
  width: 3px;
}

.device-iphone-14-pro .device-btns::after,
.device-iphone-14-pro .device-btns::before {
  background: #1b1721;
  border-radius: 2px;
  content: "";
  height: 62px;
  left: 0;
  position: absolute;
  width: 3px;
}

.device-iphone-14-pro .device-btns::after { top: 60px; }
.device-iphone-14-pro .device-btns::before { top: 140px; }

.device-iphone-14-pro .device-power {
  background: #1b1721;
  border-radius: 2px;
  height: 100px;
  position: absolute;
  right: -2px;
  top: 200px;
  width: 3px;
}

.device-iphone-14-pro .device-home::after,
.device-iphone-14-pro .device-home::before {
  border: solid rgba(1, 1, 1, .25);
  border-width: 6px 0;
  content: "";
  height: 6px;
  position: absolute;
  width: 6px;
  z-index: 9;
}

.device-iphone-14-pro .device-home::after { right: 86px; top: 0; }
.device-iphone-14-pro .device-home::before { bottom: 0; left: 86px; }

/* iPhone Black variant */
.device-iphone-14-pro.device-black .device-frame {
  border-color: #5c5956;
  box-shadow: inset 0 0 4px 2px white, inset 0 0 0 6px #76726f;
}

.device-iphone-14-pro.device-black .device-btns,
.device-iphone-14-pro.device-black .device-btns::after,
.device-iphone-14-pro.device-black .device-btns::before,
.device-iphone-14-pro.device-black .device-power {
  background: #5c5956;
}

/* ============================================================
   Device: iPad Pro
   ============================================================ */
.ws-device--tablet {
    width: 246px;
    height: 400px;
    top: 230px;
    left: 120px;
    z-index: 3;
}

.device-ipad-pro {
  height: 778px;
  width: 560px;
}

.device-ipad-pro .device-frame {
  background: #0d0d0d;
  border-radius: 36px;
  box-shadow: inset 0 0 0 1px #babdbf, inset 0 0 1px 3px #e2e3e4;
  height: 778px;
  padding: 27px;
  position: relative;
  width: 560px;
}

.device-ipad-pro .device-screen {
  border: 2px solid #121212;
  border-radius: 11px;
  height: 724px;
  width: 506px;
}

.device-ipad-pro .device-btns::after,
.device-ipad-pro .device-btns::before {
  background: #babdbf;
  content: "";
  position: absolute;
}

.device-ipad-pro .device-btns::after {
  height: 2px;
  right: 40px;
  top: -2px;
  width: 36px;
}

.device-ipad-pro .device-btns::before {
  box-shadow: 0 37px #babdbf;
  height: 32px;
  right: -2px;
  top: 63px;
  width: 2px;
}

.device-ipad-pro .device-sensors::after,
.device-ipad-pro .device-sensors::before {
  content: "";
  position: absolute;
}

.device-ipad-pro .device-sensors::after {
  background: #1a1a1a;
  border-radius: 17px;
  box-shadow: -20px 0 #1a1a1a, 70px 0 #1a1a1a;
  height: 10px;
  left: 50%;
  margin-left: -30px;
  top: 12px;
  width: 10px;
}

.device-ipad-pro .device-sensors::before {
  background: radial-gradient(farthest-corner at 20% 20%, #6074bf 0, transparent 40%), radial-gradient(farthest-corner at 80% 80%, #513785 0, #24555e 20%, transparent 50%);
  border-radius: 50%;
  box-shadow: 0 0 1px 1px rgba(255, 255, 255, .05);
  height: 6px;
  left: 50%;
  margin-left: -3px;
  top: 14px;
  width: 6px;
}

/* iPad Pro Space Gray variant */
.device-ipad-pro.device-spacegray .device-frame {
  box-shadow: inset 0 0 0 1px #6a6d70, inset 0 0 1px 3px #83878a;
}

.device-ipad-pro.device-spacegray .device-btns::after,
.device-ipad-pro.device-spacegray .device-btns::before {
  background: #6a6d70;
}

.device-ipad-pro.device-spacegray .device-btns::before {
  box-shadow: 0 37px #6a6d70;
}

/* ============================================================
   Device: MacBook Pro
   ============================================================ */
.ws-device--laptop {
    width: 477px;
    height: 307px;
    top: 264px;
    left: 560px;
    z-index: 2;
}

.device-macbook-pro {
  height: 434px;
  width: 740px;
}

.device-macbook-pro .device-frame {
  background: #0d0d0d;
  border-radius: 20px;
  box-shadow: inset 0 0 0 2px #c8cacb;
  height: 418px;
  margin: 0 auto;
  padding: 9px 9px 23px 9px;
  position: relative;
  width: 618px;
}

.device-macbook-pro .device-frame::after {
  background: linear-gradient(to bottom, #272727, #0d0d0d);
  border-radius: 0 0 20px 20px;
  bottom: 2px;
  content: "";
  height: 24px;
  left: 2px;
  position: absolute;
  width: 614px;
}

.device-macbook-pro .device-header {
  background: #0d0d0d;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  height: 12px;
  left: 50%;
  margin-left: -32px;
  position: absolute;
  top: 11px;
  width: 64px;
  z-index: 2;
}

.device-macbook-pro .device-header::after,
.device-macbook-pro .device-header::before {
  content: "";
  height: 4px;
  position: absolute;
  top: 0;
  width: 4px;
}

.device-macbook-pro .device-header::after {
  background: radial-gradient(circle at bottom left, transparent 0, transparent 75%, #0d0d0d 75%, #0d0d0d 100%);
  left: -4px;
}

.device-macbook-pro .device-header::before {
  background: radial-gradient(circle at bottom right, transparent 0, transparent 75%, #0d0d0d 75%, #0d0d0d 100%);
  right: -4px;
}

.device-macbook-pro .device-screen {
  border: 2px solid #121212;
  border-radius: 10px 10px 0 0;
  height: 375px;
  width: 600px;
}

.device-macbook-pro .device-power {
  background: radial-gradient(circle at center, #e2e3e4 85%, #c8cacb 100%);
  border: solid #a0a3a7;
  border-radius: 2px 2px 12px 12px;
  border-width: 1px 2px 0 2px;
  box-shadow: inset 0 -2px 8px 0 #6c7074;
  height: 24px;
  margin-top: -10px;
  position: relative;
  width: 740px;
  z-index: 9;
}

/* MacBook Pro Space Gray variant */
.device-macbook-pro.device-spacegray .device-frame {
  box-shadow: inset 0 0 0 2px #767a7d;
}

.device-macbook-pro.device-spacegray .device-power {
  background: radial-gradient(circle at center, #83878a 85%, #767a7d 100%);
  border-color: #454749;
  box-shadow: inset 0 -2px 8px 0 #202121;
}

/* ============================================================
   Device: Pro Display XDR
   ============================================================ */
.ws-device--desktop {
    width: 566px;
    height: 538px;
    top: 0;
    left: 220px;
    z-index: 1;
}

.device-pro-display-xdr {
  height: 475px;
  width: 640px;
}

.device-pro-display-xdr .device-frame {
  background: #151515;
  border-radius: 4px;
  box-shadow: inset 0 0 2px #d4d5d7;
  height: 368px;
  padding: 8px;
  position: relative;
  width: 640px;
}

.device-pro-display-xdr .device-frame::before {
  background: #050505;
  border-radius: 50%;
  content: "";
  height: 6px;
  left: 50%;
  margin-left: -3px;
  position: absolute;
  text-align: center;
  top: 6px;
  width: 6px;
  z-index: 9;
}

.device-pro-display-xdr .device-screen {
  border: 2px solid #121212;
  border-radius: 2px;
  height: 352px;
  width: 624px;
}

.device-pro-display-xdr .device-power::after {
  background: radial-gradient(circle at center, #d4d5d7 85%, #9fa1a6 100%);
  border-top: 1px solid #d4d5d7;
  content: "";
  height: 6px;
  margin: 0 auto;
  position: relative;
  width: 152px;
}

.device-pro-display-xdr .device-power::before {
  background: linear-gradient(to bottom, #9fa1a6 0, #c7c8cb 40%, #c7c8cb 85%, white 90%, #6b6e74 100%);
  content: "";
  height: 102px;
  margin: 0 auto;
  position: relative;
  width: 152px;
}

.device-pro-display-xdr .device-home {
  background: transparent;
  border-radius: 0 0 3px 3px;
  bottom: -2px;
  box-shadow: -61px 0 #6b6e74, 61px 0 #6b6e74;
  height: 1px;
  left: 50%;
  margin-left: -15px;
  position: absolute;
  width: 30px;
}

/* ============================================================
   Responsive Scaling (original positioning preserved)
   ============================================================ */
@media (max-width: 1160px) {
    .ws-display {
        width: 95%;
        height: 550px;
        transform: scale(0.81);
        -webkit-transform: scale(0.81);
    }
    .ws-device--desktop { left: 180px; }
    .ws-device--laptop  { left: 520px; }
    .ws-device--tablet  { left: 80px; }
    .ws-device--mobile  { left: 260px; }
}

@media (max-width: 1070px) {
    .ws-display { left: -50px; }
}

@media (max-width: 1000px) {
    .ws-display {
        height: 500px;
        transform: scale(0.71);
        -webkit-transform: scale(0.71);
        top: -40px;
    }
    .ws-device--desktop { left: 140px; }
    .ws-device--laptop  { left: 480px; }
    .ws-device--tablet  { left: 40px; }
    .ws-device--mobile  { left: 220px; }
}

@media (max-width: 850px) {
    .ws-display {
        height: 500px;
        transform: scale(0.65);
        -webkit-transform: scale(0.65);
    }
    .ws-device--desktop { left: 100px; }
    .ws-device--laptop  { left: 440px; }
    .ws-device--tablet  { left: 0; }
    .ws-device--mobile  { left: 180px; }
}

@media (max-width: 768px) {
    .ws-display {
        height: 450px;
        transform: scale(0.55);
        -webkit-transform: scale(0.55);
    }
    .ws-url__btn { width: 60px; font-size: 1.1em; }
    .ws-url__input { font-size: 0.95em; }
}

@media (max-width: 670px) {
    .ws-display {
        height: 400px;
        left: -70px;
        transform: scale(0.45);
        -webkit-transform: scale(0.45);
    }
}

@media (max-width: 560px) {
    .ws-display {
        height: 270px;
        top: -65px;
        transform: scale(0.37);
        -webkit-transform: scale(0.37);
    }
}

@media (max-width: 440px) {
    .ws-display {
        left: -17px;
        top: -65px;
        width: 70px;
        transform: scale(0.35);
        -webkit-transform: scale(0.35);
    }
    .ws-url__title { font-size: 1.3em; }
}

@media (max-width: 380px) {
    .ws-display {
        height: 235px;
        left: -17px;
        top: -65px;
        width: 70px;
        transform: scale(0.27);
        -webkit-transform: scale(0.27);
    }
    .ws-device--desktop { left: 100px; }
    .ws-device--laptop  { left: 515px; }
    .ws-device--tablet  { left: 0; }
    .ws-device--mobile  { left: 180px; }
    .ws-url__title      { font-size: 1.1em; }
}
