﻿/* =======================================================================
   模組名稱：睡羅漢名片站 / 微型創富自建站 (全域核心樣式)
   程式版本：V0.06 (CSS 獨立版)
   作  者：五元網站-Tiger老師
   設計重點：3D 空間轉場、毛玻璃擬態、RWD 自適應、行動版聯絡表單
======================================================================== */

/* --- 全域變數定義 --- */
:root {
   --menu-bg: rgba(0, 0, 0, 0.85);
   --glass-bg: rgba(255, 255, 255, 0.15);
   --glass-border: rgba(255, 255, 255, 0.3);
}

/* --- 基礎重置 --- */
* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

/* 外層環境：滿版與防溢出 */
body, html {
   width: 100%;
   height: 100%;
   overflow: hidden;
   background: #111; 
   font-family: "微軟正黑體", Arial, sans-serif;
}

/* --- 3D 舞台與跑馬燈 --- */
#stage {
   width: 100%;
   height: 100%;
   perspective: 1500px; 
   position: relative;
   overflow: hidden;
}

#menuBtn {
   position: absolute; 
   top: 15px;
   right: 15px;
   z-index: 1000; 
   background: rgba(0,0,0,0.4);
   color: #FFF;
   border: 1px solid rgba(255,255,255,0.5);
   padding: 10px 18px;
   border-radius: 25px;
   font-size: 15px;
   backdrop-filter: blur(8px);
   cursor: pointer;
}

.stage-marquee {
   position: absolute;
   top: 18px;
   left: 15px;
   right: 105px;
   height: 39px;
   background: rgba(0, 0, 0, 0.15);
   border: 2px solid rgba(255,255,255,0.15);
   border-radius: 5px;
   display: flex;
   align-items: center;
   overflow: hidden;
   z-index: 999;
   backdrop-filter: blur(5px);
   -webkit-backdrop-filter: blur(5px);
}
.stage-marquee-text {
   white-space: nowrap;
   font-size: 15px;
   color: #FFD700;
   font-weight: bold;
   letter-spacing: 1px;
   padding-left: 100%;
   animation: marquee-scroll 20s linear infinite; 
}
@keyframes marquee-scroll {
   0% { transform: translateX(0); }
   98% { transform: translateX(-100%); }
   100% { transform: translateX(-100%); }
}

/* --- SEO 熱搜標籤 TAG 樣式 --- */
.tag-badge {
   display: inline-block;
   padding: 6px 14px;
   background: rgba(255, 255, 255, 0.05);
   border: 1px solid rgba(255, 255, 255, 0.2);
   border-radius: 20px;
   font-size: 13px;
   color: #EEE;
   text-decoration: none;
   letter-spacing: 1px;
   transition: all 0.3s ease;
}
.tag-badge:hover {
   background: #186c3b;
   border-color: #186c3b;
   color: #FFF;
   box-shadow: 0 2px 8px rgba(24, 108, 59, 0.5);
}

/* --- 9大區塊 3D 面板與引擎轉場 --- */
.cube-panel {
   position: absolute;
   top: 0; left: 0; width: 100%; height: 100%;
   backface-visibility: hidden;
   transition: transform 1.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
   opacity: 0; z-index: 1;
   padding: 70px 20px 90px 20px;
   color: #FFF;
   box-shadow: 0 0 40px rgba(0,0,0,0.6) inset;
   overflow-y: auto;
   /* 引擎 A：原生 3D 翻轉 */
   transform: rotateY(90deg);
   transform-origin: right center;
}

.cube-panel.active {
   transform: rotateY(0deg);
   transform-origin: center center;
   opacity: 1; z-index: 10;
}

.cube-panel.hidden-left {
   transform: rotateY(-90deg);
   transform-origin: left center;
   opacity: 0; z-index: 1;
}

.cube-panel.hidden-right {
   transform: rotateY(90deg);
   transform-origin: right center;
   opacity: 0; z-index: 1;
}

/* 引擎 B：絲滑平移 */
#stage.anim-slide .cube-panel { transform: translateX(100%) rotateY(20deg); transform-origin: center center; }
#stage.anim-slide .cube-panel.active { transform: translateX(0) rotateY(0deg); }
#stage.anim-slide .cube-panel.hidden-left { transform: translateX(-100%) rotateY(-20deg); }
#stage.anim-slide .cube-panel.hidden-right { transform: translateX(100%) rotateY(20deg); }

/* 9大區塊獨立初始底色 */
#sec-home    { background: linear-gradient(135deg, #E74C3C, #C0392B); }
#sec-service { background: linear-gradient(135deg, #3498DB, #2980B9); }
#sec-product { background: linear-gradient(135deg, #2ECC71, #27AE60); }
#sec-brand   { background: linear-gradient(135deg, #F1C40F, #F39C12); }
#sec-video   { background: linear-gradient(135deg, #9B59B6, #8E44AD); }
#sec-qa      { background: linear-gradient(135deg, #1ABC9C, #16A085); }
#sec-contact { background: linear-gradient(135deg, #34495E, #2C3E50); }
#sec-friend  { background: linear-gradient(135deg, #E67E22, #D35400); }
#sec-color   { background: linear-gradient(135deg, #95A5A6, #7F8C8D); }

/* --- UI 卡片與排版共用樣式 --- */
.sec-title {
   font-size: 28px;
   font-weight: bold;
   margin-bottom: 20px;
   text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
   text-align: center;
   border-bottom: 2px solid rgba(255,255,255,0.3);
   padding-bottom: 10px;
}

.glass-card {
   background: var(--glass-bg);
   border: 1px solid var(--glass-border);
   border-radius: 10px;
   padding: 20px;
   margin-bottom: 10px;
   backdrop-filter: blur(5px); 
   box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn {
   display: inline-block;
   background: #FFF;
   color: #333;
   padding: 10px 20px;
   border-radius: 25px;
   text-decoration: none;
   font-weight: bold;
   text-align: center;
   width: 100%;
   margin-top: 10px;
   box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.form-input {
   width: 100%;
   padding: 12px;
   margin-bottom: 15px;
   border-radius: 8px;
   border: none;
   background: rgba(255,255,255,0.9);
   font-size: 16px;
}

.grid-2 {
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 15px;
}

/* 12 色票專用網格排版 */
.color-grid {
   display: grid;
   grid-template-columns: repeat(3, 1fr); 
   gap: 12px;
   text-align: center;
}
@media (min-width: 768px) {
   .color-grid { grid-template-columns: repeat(4, 1fr); } 
}
.color-item { cursor: pointer; }
.color-swatch {
   height: 50px;
   border-radius: 8px;
   border: 2px solid rgba(255,255,255,0.8);
   margin-bottom: 5px;
   box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.color-name {
   font-size: 13px;
   color: #EEE;
   text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* --- 影音與圖片元件 --- */
.video-wrapper {
   position: relative;
   padding-bottom: 56.25%; 
   height: 0;
   overflow: hidden;
   border-radius: 10px;
   margin-bottom: 15px;
}
.video-wrapper iframe {
   position: absolute;
   top: 0; left: 0; width: 100%; height: 100%; border: 0;
}
.mock-img {
   width: 100%; height: 120px;
   background: rgba(0,0,0,0.3);
   border-radius: 8px; margin-bottom: 10px;
   display: flex; align-items: center; justify-content: center;
   font-size: 14px; color: rgba(255,255,255,0.7);
}
.yt-facade {
   position: relative; padding-bottom: 56.25%; height: 0; width: 100%; 
   cursor: pointer; background: #000; overflow: hidden;
}
.yt-facade img {
   position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
   object-fit: cover; opacity: 0.8; transition: opacity 0.3s;
}
.yt-facade:hover img { opacity: 1; }

.yt-play-btn {
   position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
   width: 50px; height: 35px; background: rgba(255, 0, 0, 0.9);
   border-radius: 8px; display: flex; justify-content: center; align-items: center;
   box-shadow: 0 4px 15px rgba(0,0,0,0.5); transition: all 0.3s ease;
}
.yt-play-btn::before {
   content: ''; display: block; border-style: solid;
   border-width: 8px 0 8px 14px; border-color: transparent transparent transparent #FFF;
   margin-left: 3px;
}
.yt-facade:hover .yt-play-btn { background: #FF0000; transform: translate(-50%, -50%) scale(1.1); }

/* --- 右側滑出選單與導航 --- */
#rightMenu {
   position: absolute; top: 0; right: -250px; width: 250px; height: 100%;
   background: var(--menu-bg); color: #FFF; transition: right 0.4s ease;
   z-index: 1001; padding-top: 60px; box-shadow: -5px 0 20px rgba(0,0,0,0.6);
}
#rightMenu.open { right: 0; }
.menu-item {
   display: block; padding: 18px 25px; color: #FFF; text-decoration: none;
   font-size: 1.1em; border-bottom: 1px solid rgba(255,255,255,0.1);
}

#topNav {
   position: absolute; top: 0; left: 0; width: 100%; height: 60px;
   background: rgba(0, 0, 0, 0.4); border-bottom: 1px solid rgba(255, 255, 255, 0.2);
   display: flex;
}
.top-nav-item {
   flex: 1; color: #FFF; text-decoration: none; font-size: 14px;
   display: flex; align-items: center; justify-content: center;
   transition: background 0.3s; cursor: pointer;
}
.top-nav-item:hover { background: rgba(255, 255, 255, 0.15); }
.top-nav-item i { font-size: 18px; margin-right: 6px; }
.nav-divider { width: 2px; background: rgba(255, 255, 255, 0.5); margin: 15px 0; }

#bottomNav {
   position: absolute; bottom: 0; left: 0; right: 0; margin: 0 auto;
   width: 100%; background: var(--menu-bg); backdrop-filter: blur(8px);
   display: flex; justify-content: space-around; align-items: center;
   height: 55px; z-index: 1000; border-top: 1px solid rgba(255,255,255,0.2);
}
.bottom-nav-item {
   color: #FFF; text-decoration: none; font-size: 15px; flex: 1; text-align: center;
   border-right: 1px solid rgba(255,255,255,0.1); height: 100%;
   display: flex; align-items: center; justify-content: center;
}
.bottom-nav-item:last-child { border-right: none; }

/* --- 睡羅漢專屬 Modal 彈窗樣式 --- */
#saOverlay {
   position: fixed; top: 0; left: 0; width: 100%; height: 100%;
   background: rgba(0,0,0,0.7); z-index: 2147483640; 
   opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
#saOverlay.show { opacity: 1; visibility: visible; }
#sleepArhatModal {
   position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%) scale(0.9);
   width: 90vw; max-width: 800px; background-color: var(--menu-bg); 
   border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); overflow: hidden; 
   z-index: 2147483647; opacity: 0; visibility: hidden; transition: all 0.3s ease;
   border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
#sleepArhatModal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.sa-btn-x {
   position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
   background: rgba(0, 0, 0, 0.4); color: #FFF; border: 1px solid rgba(255, 255, 255, 0.3);
   border-radius: 50%; font-size: 22px; line-height: 28px; text-align: center;
   cursor: pointer; z-index: 10; backdrop-filter: blur(4px); transition: background 0.3s, transform 0.2s;
}
.sa-btn-x:hover { background: rgba(0, 0, 0, 0.7); transform: scale(1.1); }
.sa-banner { display: block; width: 100%; }
.sa-banner img { width: 100%; display: block; height: auto; border-bottom: 1px solid rgba(255,255,255,0.2); }
.sa-btn-group { display: flex; }
.sa-btn-group button {
   flex: 1; padding: 15px 0; border: none; font-size: 16px; cursor: pointer;
   font-weight: bold; background: transparent; transition: background 0.3s;
}
.sa-btn-info { color: #2ECC71; }
.sa-btn-info:hover { background: rgba(46, 204, 113, 0.2); }
.sa-btn-close { color: #95A5A6; border-left: 1px solid rgba(255,255,255,0.2); }
.sa-btn-close:hover { background: rgba(255, 255, 255, 0.1); }

/* --- 自訂毛玻璃提示彈窗 --- */
#customAlertOverlay {
   position: fixed; top: 0; left: 0; width: 100%; height: 100%;
   background: rgba(0,0,0,0.7); z-index: 2147483650; 
   opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
#customAlertOverlay.show { opacity: 1; visibility: visible; }
#customAlertModal {
   position: fixed; top: 35%; left: 50%; transform: translate(-50%, -50%) scale(0.9);
   width: 80vw; max-width: 320px; background: rgba(25, 25, 25, 0.85);
   border: 1px solid rgba(255,255,255,0.3); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.6);
   z-index: 2147483651; opacity: 0; visibility: hidden; transition: all 0.3s ease;
   backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); text-align: center; color: #FFF; padding: 25px 20px 20px 20px;
}
#customAlertModal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.alert-msg { font-size: 16px; margin-bottom: 20px; font-weight: bold; }
.alert-btn {
   background: #2ECC71; color: #FFF; border: none; padding: 10px 30px;
   border-radius: 25px; font-size: 15px; cursor: pointer; font-weight: bold;
   box-shadow: 0 2px 5px rgba(0,0,0,0.3); transition: background 0.3s;
}
.alert-btn:hover { background: #27AE60; }

/* --- App 容器全域基礎設定與桌機置中模擬器 --- */
.cube-container {
   position: relative; width: 100vw; height: 100%;
   background-image: url('https://www.top1.tw/450px.jpg'); background-repeat: no-repeat;
   background-size: contain; background-position: center; overflow: hidden;
}
@media (min-width: 768px) {
   body { background: #fff; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
   .cube-container {
      width: 420px; height: 860px; max-height: 95vh; background: #111;
      background-image: url('https://www.top1.tw/450px.jpg'); background-repeat: no-repeat;
      background-size: contain; background-position: center; 
      border-radius: 30px; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
      overflow: hidden; 
   }
}

/* --- 自適應極細毛玻璃捲軸 --- */
.cube-panel::-webkit-scrollbar, #rightMenu::-webkit-scrollbar { width: 5px; }
.cube-panel::-webkit-scrollbar-track, #rightMenu::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 10px; }
.cube-panel::-webkit-scrollbar-thumb, #rightMenu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.35); border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.1); }
.cube-panel::-webkit-scrollbar-thumb:hover, #rightMenu::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.6); }
.cube-panel, #rightMenu { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.35) transparent; }

/* --- 商品詳情專屬 Modal --- */
#productOverlay { 
   position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
   background: rgba(0,0,0,0.5); z-index: 2147483640; opacity: 0; visibility: hidden; transition: all 0.3s ease; 
}
#productOverlay.show { opacity: 1; visibility: visible; }
#productModal { 
   position: fixed; top: 42%; left: 50%; transform: translate(-50%, -50%) scale(0.95); 
   width: 90vw; max-width: 420px; max-height: 85vh; display: flex; flex-direction: column; 
   background: rgba(20, 20, 20, 0.95); border: 1px solid rgba(255,255,255,0.2); 
   border-radius: 12px; box-shadow: 0 15px 50px rgba(0,0,0,0.8); z-index: 2147483641; 
   opacity: 0; visibility: hidden; transition: all 0.3s ease; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
   overflow: hidden; color: #FFF;
}
#productModal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.pm-header { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.pm-title { font-size: 18px; font-weight: bold; margin: 0; letter-spacing: 1px; }
.pm-close { background: none; border: none; color: #FFF; font-size: 28px; cursor: pointer; transition: color 0.2s; line-height: 1; padding: 0; }
.pm-close:hover { color: #FF4757; }
.pm-body { flex: 1; overflow-y: auto; position: relative; padding: 0; }
.pm-body::-webkit-scrollbar { width: 5px; }
.pm-body::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 10px; }
.pm-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.35); border-radius: 10px; }
.pm-img-wrap { position: relative; width: 100%; }
.pm-img { width: 100%; display: block; }
.pm-price-box { 
   position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); 
   background: rgba(24, 108, 59, 0.95); border: 2px solid rgba(255,255,255,0.9); padding: 8px 25px; 
   border-radius: 30px; box-shadow: 0 5px 15px rgba(0,0,0,0.6); font-size: 20px; font-weight: bold; color: #FFF; 
   letter-spacing: 1px; white-space: nowrap;
}
.pm-desc { padding: 18px 20px 25px 20px; font-size: 14px; line-height: 1.7; color: #EEE; text-align: justify; }

/* --- 寫信給我們 (行動版表單排版樣式) --- */
.form-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 18px; width: 100%; }
.form-row-inline { flex-direction: row; align-items: center; }
.form-row > label { font-size: 14px; color: #FFF; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); margin-bottom: 8px; }
.form-row-inline > label { margin-bottom: 0; width: 85px; flex-shrink: 0; }
.form-input-sm { 
   width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 4px; 
   border: 1px solid rgba(255,255,255,0.8); background: rgba(255,255,255,0.9); font-size: 14px; color: #333; margin-bottom: 0; 
}
.form-input-sm:focus { outline: none; border-color: #3498DB; box-shadow: 0 0 5px rgba(52, 152, 219, 0.8); }
.textarea-tall { min-height: 180px; resize: vertical; }
.radio-group { display: flex; flex-direction: row; align-items: center; gap: 20px; }
.radio-group-vertical { display: flex; flex-direction: column; gap: 12px; }
.radio-item { display: flex; align-items: center; font-size: 14px; color: #FFF; }
.radio-item input[type="radio"] { margin: 0 8px 0 0; cursor: pointer; }
.radio-item label { cursor: pointer; line-height: 1.4; }