/* ═══════════════════════════════════════════════════════════════════
   YT Verify PDF — Frontend Styles
   紫色 gradient 主題，呼應原本 14_文章.py 的視覺風格
   ═══════════════════════════════════════════════════════════════════ */

.ytverify-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: clamp(10px, 2vw, 18px);
    padding: clamp(16px, 3vw, 32px);
    margin: clamp(16px, 4vw, 40px) 0;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
    border: 3px solid #818cf8;
    position: relative;
    overflow: hidden;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.6;
}

.ytverify-container * {
    box-sizing: border-box;
}

.ytverify-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.ytv-inner {
    position: relative;
    z-index: 1;
}

/* ─── 標題 ─── */
.ytv-title {
    font-size: clamp(20px, 4vw, 30px);
    color: #fbbf24;
    margin: 0 0 16px;
    text-align: center;
    font-weight: 900;
    text-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.ytv-subtitle {
    text-align: center;
    margin: 0 0 18px;
    font-size: clamp(14px, 2.5vw, 18px);
    opacity: 0.95;
}

/* ─── 稀缺性面板 ─── */
.ytv-scarcity-panel {
    background: rgba(0,0,0,0.3);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: clamp(12px, 2.5vw, 20px);
    margin: 0 0 18px;
    text-align: center;
}

.ytv-scarcity-row {
    display: flex;
    gap: clamp(12px, 3vw, 32px);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-size: clamp(15px, 2.8vw, 22px);
    font-weight: 800;
    color: #fbbf24;
}

.ytv-scarcity-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ytv-countdown {
    font-family: "SF Mono", Monaco, Consolas, monospace;
    background: rgba(251, 191, 36, 0.15);
    padding: 4px 12px;
    border-radius: 6px;
    color: #fff;
    min-width: 110px;
    display: inline-block;
}

/* ─── 步驟說明 ─── */
.ytv-steps {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: clamp(12px, 2.5vw, 20px);
    margin: 0 0 18px;
}

.ytv-steps p {
    margin: 6px 0;
    font-size: clamp(14px, 2.6vw, 17px);
}

/* ─── 輸入框 ─── */
.ytv-input-wrap {
    margin: 0 0 14px;
}

.ytv-input {
    width: 100%;
    padding: clamp(12px, 2.5vw, 16px);
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 10px;
    background: rgba(255,255,255,0.95);
    color: #1f2937;
    font-size: clamp(15px, 3vw, 18px);
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}

.ytv-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3);
}

/* ─── 按鈕 ─── */
.ytv-btn {
    display: block;
    width: 100%;
    padding: clamp(14px, 3vw, 20px);
    border: none;
    border-radius: 12px;
    background: #fbbf24;
    color: #1e293b;
    font-size: clamp(16px, 3.2vw, 20px);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    transition: all 0.2s;
    margin: 0 0 12px;
    font-family: inherit;
}

.ytv-btn:hover { background: #f59e0b; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
.ytv-btn:active { transform: translateY(0); }
.ytv-btn:disabled { background: #9ca3af; cursor: not-allowed; transform: none; }

.ytv-btn-secondary {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
}
.ytv-btn-secondary:hover { background: rgba(255,255,255,0.3); }

.ytv-btn-member {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

/* ─── 提示文字 ─── */
.ytv-hint {
    font-size: clamp(12px, 2.3vw, 14px);
    opacity: 0.9;
    text-align: center;
    margin: 8px 0;
    line-height: 1.5;
}

.ytv-warn {
    font-size: clamp(12px, 2.3vw, 14px);
    background: rgba(239, 68, 68, 0.2);
    border-left: 3px solid #ef4444;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 12px 0;
}

/* ─── PDF iframe 容器 (狀態 C) ─── */
.ytv-pdf-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 6;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    margin: 16px 0;
}

.ytv-pdf-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ─── 二次留言區塊 (狀態 C 末) ─── */
.ytv-second-comment {
    background: rgba(0,0,0,0.25);
    border: 2px dashed #fbbf24;
    border-radius: 12px;
    padding: clamp(14px, 2.8vw, 22px);
    margin: 18px 0 0;
    white-space: pre-line;
    font-size: clamp(14px, 2.6vw, 17px);
    line-height: 1.7;
}

/* ─── 4 種錯誤原因 (狀態 E) ─── */
.ytv-reasons {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: clamp(12px, 2.5vw, 18px);
    margin: 12px 0;
}

.ytv-reasons p {
    margin: 8px 0;
    font-size: clamp(13px, 2.5vw, 16px);
}

/* ─── Spinner ─── */
.ytv-loading-shell {
    text-align: center;
    padding: 40px 20px;
}

.ytv-spinner-large {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: ytv-spin 1s linear infinite;
}

@keyframes ytv-spin { to { transform: rotate(360deg); } }

/* ─── noscript ─── */
.ytv-noscript {
    background: #fee2e2;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    border: 2px solid #ef4444;
}

/* ─── divider ─── */
.ytv-divider {
    border: none;
    border-top: 1px dashed rgba(255,255,255,0.3);
    margin: 18px 0;
}

/* ═══════════════════════════════════════════════════════════════════
   v1.0.3: 二次留言 popup (modal)
   觸發時機：下載按鈕被點擊後
   ═══════════════════════════════════════════════════════════════════ */
.ytv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ytv-fadein 0.2s ease-out;
    backdrop-filter: blur(4px);
}

@keyframes ytv-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ytv-modal-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #fbbf24;
    border-radius: clamp(12px, 2vw, 20px);
    padding: clamp(20px, 4vw, 36px);
    max-width: 520px;
    width: 100%;
    color: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
    animation: ytv-slideup 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

@keyframes ytv-slideup {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ytv-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}
.ytv-modal-close:hover { color: #fff; }

.ytv-modal-title {
    font-size: clamp(18px, 3.5vw, 24px);
    color: #fbbf24;
    font-weight: 900;
    margin: 0 0 14px;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.ytv-modal-body {
    font-size: clamp(14px, 2.8vw, 17px);
    line-height: 1.7;
    white-space: pre-line;
    margin: 0 0 20px;
    color: rgba(255,255,255,0.95);
}

.ytv-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ytv-modal-actions .ytv-btn {
    flex: 1 1 48%;
    margin: 0;
    font-size: clamp(14px, 2.6vw, 17px);
    padding: clamp(12px, 2.4vw, 16px);
}

/* v1.0.4: 阻擋 iframe 右上角 "在新視窗開啟" 按鈕，讓觀眾停留在本站 */
.ytv-pdf-frame { position: relative; }
.ytv-pdf-frame::after {
    content: ''; position: absolute; top: 0; right: 0;
    width: 56px; height: 56px; background: transparent;
    pointer-events: auto; z-index: 10; cursor: default;
}
