/* ===== 全局重置 & 基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #1e293b;
    padding: 24px 16px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1200px;
}

/* ===== 头部 ===== */
.header {
    text-align: center;
    padding: 24px 0 20px;
}
.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #1e293b, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header p {
    color: #64748b;
    margin-top: 6px;
    font-size: 15px;
}

/* ===== 控制面板 ===== */
.control-panel {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 24px 28px;
    margin-bottom: 28px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 20px;
}
.control-panel .field-group {
    display: flex;
    align-items: center;
    flex: 1 1 360px;
    gap: 0;
    border-radius: 10px;
    background: #f1f5f9;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.control-panel .field-group:focus-within {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.control-panel .field-group .label {
    background: #e2e8f0;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 14px;
    color: #334155;
    white-space: nowrap;
    border-right: 1px solid #d1d9e6;
}
.control-panel .field-group input[type="url"] {
    flex: 1;
    border: none;
    padding: 10px 16px;
    font-size: 15px;
    outline: none;
    background: transparent;
    min-width: 160px;
    color: #0f172a;
}
.control-panel .field-group input[type="url"]::placeholder {
    color: #94a3b8;
}

.control-panel .bg-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.control-panel .bg-group span {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    margin-right: 4px;
}
.control-panel .bg-group label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    cursor: pointer;
    color: #475569;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.control-panel .bg-group label:hover {
    background: #f1f5f9;
}
.control-panel .bg-group input[type="radio"] {
    accent-color: #3b82f6;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.btn-generate {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 10px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-generate:hover {
    background: #2563eb;
}
.btn-generate:active {
    transform: scale(0.97);
}

/* ===== 预览区域 ===== */
#device-preview {
    background: url(images/background.jpg) center center no-repeat;
    background-size: cover;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.10);
    margin-bottom: 24px;
    overflow: hidden;
    transition: background 0.3s;
    display: none;
    /* 由 JS 控制显示 */;
}
#device-preview.visible {
    display: block;
}

.wrapper {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 0 80px;
    position: relative;
}

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

/* 设备通用 */
.display>div {
    background-repeat: no-repeat;
    background-size: 100%;
    overflow: hidden;
    position: absolute;
}
.display iframe {
    margin: 0;
    padding: 0;
    position: relative;
    background-color: #fff;
    border: none;
    border-radius: 6px;
    transform-origin: top left;
    -webkit-transform-origin: top left;
    -moz-transform-origin: top left;
    -ms-transform-origin: top left;
    -o-transform-origin: top left;
}

/* ---- 手机 ---- */
.mobile {
    background-image: url(images/mobile.png);
    width: 95px;
    height: 196px;
    top: 375px;
    left: 300px;
    z-index: 5;
}
.mobile iframe {
    width: 384px;
    height: 832px;
    top: 5px;
    left: 6px;
    border-radius: 46px;
    transform: scale(0.219);
    -webkit-transform: scale(0.219);
    -moz-transform: scale(0.219);
    -ms-transform: scale(0.219);
    -o-transform: scale(0.219);
}

/* ---- 平板 ---- */
.tablet {
    background-image: url("images/tablet.png");
    width: 246px;
    height: 400px;
    z-index: 3;
    left: 120px;
    top: 230px;
}
.tablet iframe {
    width: 1008px;
    height: 1338px;
    top: 12px;
    left: 12px;
    overflow-y: hidden;
    border-radius: 28px;
    transform: scale(0.219);
    -webkit-transform: scale(0.219);
}

/* ---- 笔记本 ---- */
.laptop {
    background-image: url(images/laptop.png);
    width: 477px;
    height: 307px;
    top: 264px;
    left: 560px;
    z-index: 2;
}
.laptop iframe {
    width: 1311px;
    height: 825px;
    top: 12px;
    left: 57px;
    transform: scale(0.277);
    -webkit-transform: scale(0.277);
    -moz-transform: scale(0.277);
    -ms-transform: scale(0.277);
    -o-transform: scale(0.277);
}

/* ---- 台式机 ---- */
.desktop {
    background-image: url(images/large-screen-optimised.png);
    width: 566px;
    height: 538px;
    top: 0px;
    left: 220px;
    z-index: 1;
}
.desktop iframe {
    left: 11px;
    top: 23px;
    width: 1504px;
    height: 960px;
    transform: scale(0.36);
    -webkit-transform: scale(0.36);
    -moz-transform: scale(0.36);
    -ms-transform: scale(0.36);
    -o-transform: scale(0.36);
}

/* ===== 响应式缩放 ===== */
@media (max-width: 1160px) {
    .display {
        width: 95%;
        height: 550px;
        transform: scale(0.81);
        -webkit-transform: scale(0.81);
        -moz-transform: scale(0.81);
        -ms-transform: scale(0.81);
        -o-transform: scale(0.81);
    }
    .desktop {
        left: 180px;
    }
    .laptop {
        left: 520px;
    }
    .tablet {
        left: 80px;
    }
    .mobile {
        left: 260px;
    }
}
@media (max-width: 1070px) {
    .display {
        left: -50px;
    }
}
@media (max-width: 1000px) {
    .display {
        height: 500px;
        transform: scale(0.71);
        -webkit-transform: scale(0.71);
        -moz-transform: scale(0.71);
        -ms-transform: scale(0.71);
        -o-transform: scale(0.71);
        top: -40px;
    }
    .desktop {
        left: 140px;
    }
    .laptop {
        left: 480px;
    }
    .tablet {
        left: 40px;
    }
    .mobile {
        left: 220px;
    }
}
@media (max-width: 850px) {
    .display {
        height: 500px;
        transform: scale(0.65);
        -webkit-transform: scale(0.65);
        -moz-transform: scale(0.65);
        -ms-transform: scale(0.65);
        -o-transform: scale(0.65);
    }
    .desktop {
        left: 100px;
    }
    .laptop {
        left: 440px;
    }
    .tablet {
        left: 0px;
    }
    .mobile {
        left: 180px;
    }
}
@media (max-width: 768px) {
    .display {
        height: 450px;
        transform: scale(0.55);
        -webkit-transform: scale(0.55);
        -moz-transform: scale(0.55);
        -ms-transform: scale(0.55);
        -o-transform: scale(0.55);
    }
}
@media (max-width: 670px) {
    .display {
        height: 400px;
        left: -70px;
        transform: scale(0.45);
        -webkit-transform: scale(0.45);
        -moz-transform: scale(0.45);
        -ms-transform: scale(0.45);
        -o-transform: scale(0.45);
    }
}
@media (max-width: 560px) {
    .display {
        height: 270px;
        top: -65px;
        transform: scale(0.37);
        -webkit-transform: scale(0.37);
        -moz-transform: scale(0.37);
        -ms-transform: scale(0.37);
        -o-transform: scale(0.37);
    }
}
@media (max-width: 440px) {
    .display {
        left: -17px;
        top: -65px;
        width: 70px;
        transform: scale(0.35);
        -webkit-transform: scale(0.35);
        -moz-transform: scale(0.35);
        -ms-transform: scale(0.35);
        -o-transform: scale(0.35);
    }
}
@media (max-width: 380px) {
    .display {
        height: 235px;
        left: -17px;
        top: -65px;
        width: 70px;
        transform: scale(0.27);
        -webkit-transform: scale(0.27);
        -moz-transform: scale(0.27);
        -ms-transform: scale(0.27);
        -o-transform: scale(0.27);
    }
    .desktop {
        left: 100px;
    }
    .laptop {
        left: 515px;
    }
    .tablet {
        left: 0px;
    }
    .mobile {
        left: 180px;
    }
}

/* ===== 使用说明 ===== */
.readme {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    padding: 24px 28px;
    margin-top: 8px;
}
.readme h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #0f172a;
}
.readme p,
.readme li {
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
}
.readme ul {
    padding-left: 20px;
    margin: 8px 0 4px;
}
.readme li {
    margin-bottom: 2px;
}

/* ===== 工具哇品牌保留 ===== */
.brand-credit {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: #94a3b8;
}
.brand-credit a {
    color: #3b82f6;
    text-decoration: none;
}
.brand-credit a:hover {
    text-decoration: underline;
}

/* ===== 加载提示 ===== */
.loading-tip {
    display: none;
    text-align: center;
    padding: 20px 0 10px;
    color: #64748b;
    font-size: 14px;
}
.loading-tip.active {
    display: block;
}
.loading-tip .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 10px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== 移动端控制面板适配 ===== */
@media (max-width: 640px) {
    body {
        padding: 12px 8px 24px;
    }
    .header h1 {
        font-size: 22px;
    }
    .control-panel {
        padding: 16px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .control-panel .field-group {
        flex: 1 1 auto;
    }
    .control-panel .field-group .label {
        padding: 8px 12px;
        font-size: 13px;
    }
    .control-panel .field-group input[type="url"] {
        padding: 8px 12px;
        font-size: 14px;
    }
    .control-panel .bg-group {
        justify-content: center;
    }
    .btn-generate {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 15px;
    }
    .wrapper {
        padding: 30px 0 50px;
    }
    .readme {
        padding: 16px 14px;
    }
}
@media (max-width: 480px) {
    .control-panel .bg-group label {
        font-size: 13px;
        padding: 2px 6px;
    }
}