/* ================= 整体页面样式 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    min-height: 100vh;
    color: #eee;
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}
.container { width: 100%; max-width: 860px; }

/* 顶部标题 */
.header { text-align: center; margin-bottom: 28px; }
.header h1 {
    font-size: 30px;
    background: linear-gradient(90deg, #7ce0ff, #ff9a9e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header p { margin-top: 8px; color: #9fb6c4; font-size: 14px; }

/* 输入区域 */
.input-row {
    display: flex;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    padding: 12px;
    border-radius: 14px;
    backdrop-filter: blur(4px);
}
.input-row input {
    flex: 1;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
}
.input-row input::placeholder { color: #8fa3b0; }
.input-row button {
    border: none;
    cursor: pointer;
    background: linear-gradient(90deg, #36d1dc, #5b86e5);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    padding: 12px 26px;
    border-radius: 10px;
    transition: opacity .2s;
}
.input-row button:hover { opacity: .85; }
.input-row button:disabled { opacity: .5; cursor: not-allowed; }
/* 次要按钮（粘贴/清空）用浅色样式，主按钮（解析）保持渐变 */
.input-row button.secondary {
    background: rgba(255,255,255,0.14);
    font-weight: normal;
    padding: 12px 18px;
}
.input-row button.secondary:hover { background: rgba(255,255,255,0.26); opacity: 1; }

/* 提示信息（加载中 / 错误） */
.tip { text-align: center; margin-top: 20px; font-size: 14px; display: none; }
.tip.show { display: block; }
.tip.error { color: #ff7b7b; }

/* 顶部公告条（红色警示样式，提醒别外传） */
.notice {
    background: rgba(255, 87, 87, 0.14);
    border: 1px solid rgba(255, 87, 87, 0.5);
    color: #ffd7d7;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
    margin-bottom: 16px;
}

/* 微信内置浏览器全屏遮罩：微信里打开整页被遮盖，引导去浏览器 */
.wx-mask {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: linear-gradient(160deg, #f7f9fc, #e8edf5);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}
.wx-mask.show { display: flex; }
.wx-mask .wx-guide {
    position: relative;
    width: 160px;
    height: 120px;
    margin-bottom: 24px;
}
/* 右上角三个点（模拟微信菜单按钮） */
.wx-mask .wx-dots {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #07c160;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 指向右上角的箭头 */
.wx-mask .wx-arrow {
    position: absolute;
    bottom: 0;
    left: 8px;
    font-size: 72px;
    color: #07c160;
    line-height: 1;
}
.wx-mask h3 { font-size: 22px; color: #222; margin: 0 0 14px; }
.wx-mask p { font-size: 14px; color: #666; line-height: 1.9; margin: 0 0 24px; }
.wx-mask .wx-step {
    background: #07c160;
    color: #fff;
    border-radius: 24px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: bold;
}

/* 加载转圈 */
.spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #5b86e5;
    border-radius: 50%;
    vertical-align: -5px;
    margin-right: 8px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 结果卡片 ================= */
.result { display: none; margin-top: 28px; }
.result.show { display: block; }

.card {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
}
.card h2 {
    font-size: 18px;
    line-height: 1.5;
    word-break: break-all;
    margin-bottom: 14px;
}

/* 选项卡（封面 / 标题 / 内容） */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs .tab {
    flex: 1;
    border: none;
    cursor: pointer;
    background: rgba(255,255,255,0.08);
    color: #9fb6c4;
    font-size: 15px;
    padding: 10px 0;
    border-radius: 10px;
    transition: all .2s;
    font-family: inherit;
}
.tabs .tab:hover { background: rgba(255,255,255,0.14); }
.tabs .tab.active {
    background: linear-gradient(90deg, #36d1dc, #5b86e5);
    color: #fff;
    font-weight: bold;
}
/* 选项卡对应的内容面板（hidden 属性控制显示/隐藏） */
.tab-panel[hidden] { display: none; }

/* 封面大图：固定 4:3 比例，最大宽度 480px，居中显示 */
.cover {
    width: 100%;
    max-width: 480px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
    cursor: zoom-in;
    display: block;
    margin: 0 auto 14px;
    background: rgba(255,255,255,0.05);
}

/* 视频播放器：固定 16:9 比例，最大宽度 720px，居中显示 */
video {
    width: 100%;
    max-width: 720px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    background: #000;
    display: block;
    margin: 0 auto;
}

/* 操作按钮行 */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.actions a, .actions button {
    display: inline-block;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    color: #fff;
    background: rgba(255,255,255,0.14);
    padding: 9px 16px;
    border-radius: 8px;
    transition: background .2s;
    font-family: inherit;
}
.actions a:hover, .actions button:hover { background: rgba(255,255,255,0.26); }
.actions .primary {
    background: linear-gradient(90deg, #36d1dc, #5b86e5);
}
.actions .primary:hover { opacity: .85; }

/* 下载进度条 */
.progress { margin-top: 14px; }
.progress .bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.progress .bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #36d1dc, #5b86e5);
    transition: width .15s;
}
.progress .text { font-size: 12px; color: #8fa3b0; margin-top: 6px; }

/* 小字提示 */
.hint { font-size: 12px; color: #8fa3b0; margin-top: 12px; line-height: 1.6; }

/* 图集网格：每张固定 160x160 正方形，整行居中 */
.pics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}
.pics-grid img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
    cursor: zoom-in;
    background: rgba(255,255,255,0.05);
    transition: transform .2s;
}
.pics-grid img:hover { transform: scale(1.03); }

/* ================= 大图查看（lightbox）================= */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ================= 手机端适配 ================= */
@media (max-width: 520px) {
    /* 页面边距收紧，顶部留白减小 */
    body { padding: 20px 12px; }
    .header h1 { font-size: 24px; }
    .header p { font-size: 13px; }

    /* 输入区：纵向排列，按钮全宽、加大触控区 */
    .input-row { flex-direction: column; gap: 8px; padding: 10px; }
    .input-row input { padding: 13px 14px; font-size: 16px; }  /* 16px 防止苹果手机聚焦时自动放大 */
    .input-row button { width: 100%; padding: 14px 0; font-size: 16px; }
    .input-row button.secondary { padding: 13px 0; font-size: 15px; }

    /* 结果卡片：内边距收紧 */
    .card { padding: 16px; }
    .card h2 { font-size: 16px; }

    /* 选项卡：加大点击区域，方便手指点 */
    .tabs { gap: 6px; }
    .tabs .tab { font-size: 14px; padding: 12px 0; }

    /* 操作按钮：整行排布，每个都够大 */
    .actions { gap: 8px; }
    .actions a, .actions button {
        flex: 1 1 auto;
        text-align: center;
        padding: 12px 10px;
        font-size: 14px;
    }

    /* 进度条文字稍大，手机上好读 */
    .progress .text { font-size: 13px; }

    /* 图集网格：手机上每张 150px，更紧凑 */
    .pics-grid { grid-template-columns: repeat(auto-fill, 150px); gap: 8px; }
    .pics-grid img { width: 150px; height: 150px; }

    /* 微信遮罩文字适配 */
    .wx-mask h3 { font-size: 20px; }
    .wx-mask p { font-size: 13px; }
    .wx-mask .wx-step { font-size: 14px; padding: 12px 18px; }

    /* 公告：手机上做成醒目的渐变卡片 */
    .notice {
        font-size: 14px;
        padding: 16px 18px;
        border-radius: 14px;
        border: 1px solid rgba(255, 130, 100, 0.55);
        background: linear-gradient(135deg, rgba(255, 87, 87, 0.22), rgba(255, 138, 51, 0.16));
        box-shadow: 0 4px 16px rgba(255, 87, 87, 0.18);
        letter-spacing: 0.3px;
    }
}
