/* ------------------------------------------------------------
 * 專案 CSS 樣式表 (Base)
 * ------------------------------------------------------------ */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --bg-blur-amount: 10px;
    --modal-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #333;
    --font-family: 'Helvetica Neue', Arial, sans-serif;
    --setup-surface: rgba(18, 22, 32, 0.92);
    --setup-card: rgba(26, 32, 45, 0.85);
    --setup-border: rgba(255, 255, 255, 0.08);
    --setup-text: rgba(255, 255, 255, 0.92);
    --setup-subtext: rgba(255, 255, 255, 0.55);
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* 防止滾動 */
    font-family: var(--font-family);
    background-color: #000;
}

/* ------------------------------------------------------------
 * 背景層 (模糊效果)
 * ------------------------------------------------------------ */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 背景圖片路徑 (相對於 public 目錄) */
    background-image: url('../img/bg.png'); /* 請將 bg.png 放到 public/assets/img/bg.png */
    background-size: cover;
    background-position: center;
    filter: blur(var(--bg-blur-amount)) brightness(0.55);
    z-index: 1;
    transition: filter 0.5s ease;
}

/* 背景暗色遮罩（讓中間內容更清楚） */
.bg-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.75));
    z-index: 2;
}

/* ------------------------------------------------------------
 * 中間清晰內容（參考截圖二 Setup 彈窗）
 * ------------------------------------------------------------ */
.setup-shell {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.setup-modal {
    width: 100%;
    max-width: 520px;
    border-radius: 14px;
    border: 1px solid var(--setup-border);
    background: var(--setup-surface);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
    padding: 18px;
    backdrop-filter: blur(8px);
}

.setup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.setup-title {
    color: var(--setup-text);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* 只顯示，不提供互動（依需求：只有 + 有作用） */
.setup-close {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    user-select: none;
}

.setup-card {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--setup-card);
}

.setup-card + .setup-card {
    margin-top: 14px;
}

.setup-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.setup-icon--blue {
    background: radial-gradient(circle at 30% 25%, rgba(120, 170, 255, 0.95), rgba(55, 95, 255, 0.25));
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.setup-icon-svg {
    width: 22px;
    height: 22px;
    color: rgba(210, 230, 255, 0.95);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.setup-plus {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid rgba(120, 255, 170, 0.12);
    background: radial-gradient(circle at 35% 25%, rgba(25, 110, 72, 0.95), rgba(14, 55, 38, 0.95));
    color: rgba(190, 255, 220, 0.95);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
    position: relative;
}

.setup-plus:hover {
    filter: brightness(1.05);
}

.setup-plus::before,
.setup-plus::after {
    content: '';
    position: absolute;
    background: rgba(170, 255, 210, 0.92);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(120, 255, 170, 0.15);
}

.setup-plus::before {
    width: 16px;
    height: 2px;
}

.setup-plus::after {
    width: 2px;
    height: 16px;
}

.setup-card-body {
    min-width: 0;
}

.setup-card-title {
    color: var(--setup-text);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.setup-card-desc {
    color: var(--setup-subtext);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.setup-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    color: rgba(120, 170, 255, 0.95);
    border: 1px solid rgba(120, 170, 255, 0.18);
    background: rgba(120, 170, 255, 0.10);
    user-select: none;
}

.setup-pill--green {
    color: rgba(120, 255, 170, 0.90);
    border: 1px solid rgba(120, 255, 170, 0.16);
    background: rgba(120, 255, 170, 0.10);
}

/* ------------------------------------------------------------
 * 彈窗層 (Modal)
 * ------------------------------------------------------------ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 半透明遮罩 */
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ------------------------------------------------------------
 * 代碼輸入彈窗 (參考 2.png 的 dark modal 樣式)
 * ------------------------------------------------------------ */
.code-modal {
    width: 92%;
    max-width: 520px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(16, 18, 28, 0.92);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.70);
    backdrop-filter: blur(10px);
    transform: translateY(18px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .code-modal {
    transform: translateY(0);
}

.code-modal-top {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    align-items: center;
    padding: 14px 14px 10px 14px;
}

.code-modal-title {
    color: rgba(255, 255, 255, 0.92);
    font-size: 20px;
    font-weight: 700;
    text-align: left;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-modal-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    user-select: none;
}

.code-modal-icon:hover {
    background: rgba(255, 255, 255, 0.06);
}

.code-modal-body {
    padding: 6px 18px 18px 18px;
}

.code-modal-label {
    display: block;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    margin-bottom: 8px;
}

.code-modal-input {
    width: 100%;
    height: 54px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(32, 45, 80, 0.35);
    color: rgba(255, 255, 255, 0.90);
    outline: none;
    padding: 0 14px;
    box-sizing: border-box;
    font-size: 16px;
}

.code-modal-input:focus {
    border-color: rgba(120, 170, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(120, 170, 255, 0.15);
}

.code-modal-desc {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 1.55;
}

.code-modal-error {
    margin-top: 10px;
    min-height: 18px;
    color: rgba(255, 120, 120, 0.92);
    font-size: 13px;
}

.code-modal-primary {
    margin-top: 16px;
    width: 260px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(120, 170, 255, 0.30);
    background: rgba(80, 130, 255, 0.85);
    color: rgba(255, 255, 255, 0.92);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.code-modal-primary:hover {
    filter: brightness(1.05);
}

/* ------------------------------------------------------------
 * 動畫層 (成功後)
 * ------------------------------------------------------------ */
.animation-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000; /* 全黑背景 */
    z-index: 200;
    color: #0f0; /* 駭客綠 */
    font-family: 'Courier New', monospace;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* 隨機亂碼文字樣式 */
#matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 201;
    pointer-events: none; /* 讓點擊穿透 */
}

/* 成功訊息 */
.success-message {
    z-index: 202;
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

.success-message h1 {
    font-size: 3rem;
    color: #fff;
    text-shadow: 0 0 10px #0f0;
}

/* 倒數計時 */
.countdown {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
    z-index: 202;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* 手機版適配 */
@media (max-width: 600px) {
    .code-modal-title {
        font-size: 18px;
    }

    .setup-modal {
        padding: 14px;
    }

    .setup-card-title {
        font-size: 18px;
    }
}
