/* ============================================================
   明亮科技風 — 疊在 Bootstrap 5 light 之上
   ============================================================ */

:root {
    --tech-bg: #f7f9fc;

    /* 亮底上的強調色刻意調深,確保文字對比足夠 */
    --tech-cyan: #0891b2;
    --tech-violet: #4f46e5;
    --tech-cyan-deep: #0e7490;
    --tech-violet-deep: #4338ca;

    --tech-line: #e4e9f0;
    --tech-surface: #ffffff;
    --tech-shadow: 0 1px 2px rgba(15, 23, 42, .04),
                   0 8px 24px -12px rgba(15, 23, 42, .12);

    --bs-body-bg: var(--tech-bg);
    --bs-body-color: #1e293b;
    --bs-secondary-color: #64748b;
    --bs-border-color: var(--tech-line);
    --bs-link-color-rgb: 8, 145, 178;
}

body {
    background: var(--tech-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
                 "Microsoft JhengHei", sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

.mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    letter-spacing: .02em;
}

/* ---------- 背景:網格 + 光暈 ---------- */

.grid-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(15, 23, 42, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, .055) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}

.glow {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.glow-1 {
    top: -10rem; left: -6rem;
    width: 30rem; height: 30rem;
    background: rgba(34, 211, 238, .3);
}

.glow-2 {
    top: 4rem; right: -8rem;
    width: 28rem; height: 28rem;
    background: rgba(129, 140, 248, .28);
}

/* ---------- 導覽列 ---------- */

.nav-glass {
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--tech-line);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2rem; height: 2rem;
    border-radius: .55rem;
    font-size: .8rem;
    color: #fff;
    background: linear-gradient(135deg, var(--tech-cyan), var(--tech-violet));
    box-shadow: 0 4px 14px -4px rgba(79, 70, 229, .55);
}

.brand-text { font-weight: 700; letter-spacing: -.01em; }

.text-gradient {
    background: linear-gradient(100deg, var(--tech-cyan), var(--tech-violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.navbar .nav-link {
    color: var(--bs-secondary-color);
    border-radius: .5rem;
    padding: .4rem .8rem;
    transition: color .18s ease, background .18s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--tech-violet-deep);
    background: rgba(79, 70, 229, .07);
}

.navbar-toggler { color: var(--tech-violet); box-shadow: none !important; }

/* ---------- 按鈕 ---------- */

.btn-glow {
    color: #fff;
    font-weight: 600;
    border: none;
    background: linear-gradient(100deg, var(--tech-cyan-deep), var(--tech-violet-deep));
    box-shadow: 0 6px 20px -8px rgba(67, 56, 202, .7);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.btn-glow:hover {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 12px 28px -8px rgba(67, 56, 202, .8);
}

.btn-ghost,
.btn-api {
    color: var(--bs-body-color);
    border: 1px solid var(--tech-line);
    background: #fff;
    box-shadow: var(--tech-shadow);
    transition: border-color .18s ease, color .18s ease, transform .18s ease;
}

.btn-ghost:hover,
.btn-api:hover {
    color: var(--tech-violet-deep);
    border-color: rgba(79, 70, 229, .45);
    transform: translateY(-2px);
}

.btn-api { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Hero ---------- */

.hero-title {
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -.03em;
    margin-bottom: .75rem;
    color: #0f172a;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .85rem;
    font-size: .72rem;
    letter-spacing: .08em;
    color: var(--tech-cyan-deep);
    border: 1px solid rgba(8, 145, 178, .25);
    border-radius: 999px;
    background: rgba(8, 145, 178, .07);
}

.pulse-dot {
    width: .45rem; height: .45rem;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    70%  { box-shadow: 0 0 0 .5rem rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0    rgba(16, 185, 129, 0); }
}

/* ---------- 卡片 ---------- */

.glass-card {
    position: relative;
    background: var(--tech-surface);
    border: 1px solid var(--tech-line);
    border-radius: 1rem;
    box-shadow: var(--tech-shadow);
    overflow: hidden;
}

/* 卡片頂端的漸層細線 */
.glass-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent,
                var(--tech-cyan), var(--tech-violet), transparent);
    opacity: .55;
}

.stat-card,
.feature-card {
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.feature-card { padding: 1.5rem; }

/* 統計卡:圖示 + 數字橫排,緊湊不空 */
.stat-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem 1.35rem;
}

.stat-card:hover,
.feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, .3);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04),
                0 14px 32px -14px rgba(79, 70, 229, .35);
}

.stat-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.6rem; height: 2.6rem;
    font-size: 1.15rem;
    border-radius: .7rem;
    background: #f1f5f9;
    border: 1px solid var(--tech-line);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: #0f172a;
}

/* Bootstrap 預設的 info / warning 在白底上太淡,壓深以維持可讀性 */
.text-info    { color: #0891b2 !important; }
.text-primary { color: #4f46e5 !important; }
.text-success { color: #059669 !important; }
.text-warning { color: #b45309 !important; }
.text-danger  { color: #dc2626 !important; }

.feature-icon { font-size: 1.5rem; display: block; margin-bottom: .6rem; }

.feature-code {
    font-size: .92rem;
    font-weight: 600;
    color: var(--tech-violet-deep);
    background: none;
    padding: 0;
}

/* ---------- 表單 ---------- */

.form-control {
    background: #fff;
    border: 1px solid #d8dfe9;
    color: var(--bs-body-color);
    border-radius: .6rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control:focus {
    background: #fff;
    color: var(--bs-body-color);
    border-color: rgba(79, 70, 229, .55);
    box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .12);
}

.form-control::placeholder { color: #94a3b8; }

.form-label { letter-spacing: .06em; text-transform: uppercase; }

/* ---------- 留言列表 ---------- */

.msg-item {
    display: flex;
    gap: .9rem;
    padding: 1rem 0;
    border-top: 1px solid var(--tech-line);
}

.msg-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.4rem; height: 2.4rem;
    border-radius: .7rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--tech-cyan), var(--tech-violet));
    box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .5);
}

.msg-item p { word-break: break-word; }
.min-w-0 { min-width: 0; }

/* ---------- 檔案結構 ---------- */

.tree {
    padding: 1.1rem;
    font-size: .82rem;
    line-height: 1.7;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid var(--tech-line);
    border-radius: .7rem;
    overflow-x: auto;
}

.footer-line { border-top: 1px solid var(--tech-line); }

/* ---------- 產品站元件 ---------- */

.section-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 800;
    letter-spacing: -.02em;
    color: #0f172a;
}

/* 資料流程 */
.flow-step {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 0;
    border-bottom: 1px dashed var(--tech-line);
}

.flow-step:last-of-type { border-bottom: none; }
.flow-num { font-size: .7rem; color: var(--tech-violet); }
.flow-icon { font-size: 1.1rem; color: var(--tech-cyan); }

/* 便利性卡片:以往 → 現在 */
.benefit-card { padding: 1.5rem; }

.benefit-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.6rem; height: 2.6rem;
    font-size: 1.15rem;
    color: #fff;
    border-radius: .7rem;
    background: linear-gradient(135deg, var(--tech-cyan), var(--tech-violet));
    box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .5);
}

.pain-row, .gain-row {
    display: flex;
    gap: .75rem;
    padding: .7rem 0;
}

.pain-row { border-bottom: 1px dashed var(--tech-line); }

.pain-label, .gain-label {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: .1rem .5rem;
    font-size: .7rem;
    border-radius: .35rem;
    white-space: nowrap;
}

.pain-label {
    color: #b45309;
    background: rgba(180, 83, 9, .09);
    border: 1px solid rgba(180, 83, 9, .2);
}

.gain-label {
    color: #047857;
    background: rgba(4, 120, 87, .09);
    border: 1px solid rgba(4, 120, 87, .22);
}

.tag-optional {
    padding: .15rem .5rem;
    font-size: .68rem;
    color: var(--tech-violet-deep);
    border: 1px solid rgba(79, 70, 229, .3);
    border-radius: 999px;
    background: rgba(79, 70, 229, .07);
}

/* 型號卡 */
.model-card {
    display: block;
    padding: 1.5rem;
    color: inherit;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.model-card:hover {
    color: inherit;
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, .3);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04),
                0 14px 32px -14px rgba(79, 70, 229, .35);
}

/* 產品照容器。
   圖片改用絕對定位,不用 grid + 百分比高度 —— Safari 在 place-items:center
   的 grid 子元素上無法解析 height:100%,會退回圖片原生高度(650px)把容器撐爆。
   絕對定位的包含塊尺寸永遠確定,百分比在所有引擎都可靠。 */
.model-shot {
    position: relative;
    height: 170px;
    margin-bottom: 1rem;
    /* 純白底:三張產品照中有兩張是白底不透明的,若用灰底會出現白色方塊接縫 */
    background: #fff;
    border: 1px solid var(--tech-line);
    border-radius: .8rem;
    overflow: hidden;          /* 最後一道防線,任何情況都不會溢出 */
}

.model-shot img {
    position: absolute;
    top: .5rem;
    left: .5rem;
    width: calc(100% - 1rem);
    height: calc(100% - 1rem);
    object-fit: contain;       /* 維持比例,不裁切不變形 */
    filter: drop-shadow(0 6px 14px rgba(15, 23, 42, .18));
}

.model-shot-lg { height: 230px; }

.model-card:hover .model-shot img {
    transform: scale(1.04);
}

.model-shot img { transition: transform .25s ease; }

.model-points {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
    color: var(--tech-violet-deep);
}

.model-points span {
    font-size: .8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.model-meta { color: var(--bs-secondary-color); }

.model-best {
    padding-top: .75rem;
    border-top: 1px dashed var(--tech-line);
    font-size: .85rem;
}

.model-best .mono {
    font-size: .7rem;
    color: var(--tech-cyan-deep);
}

/* 規格清單 */
.spec-list { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; }
.spec-list dt { font-size: .72rem; color: var(--bs-secondary-color); white-space: nowrap; }
.spec-list dd { margin: 0; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: .3rem 0; }

.note-box {
    padding: .6rem .8rem;
    font-size: .82rem;
    color: #b45309;
    background: rgba(180, 83, 9, .07);
    border: 1px solid rgba(180, 83, 9, .2);
    border-radius: .6rem;
}

/* 比較表 */
.compare-table th, .compare-table td {
    border-color: var(--tech-line);
    padding: .8rem .9rem;
}

.compare-table thead th {
    font-size: .85rem;
    color: var(--tech-violet-deep);
    background: rgba(79, 70, 229, .05);
    white-space: nowrap;
}

.compare-table tbody th {
    font-size: .85rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

/* 工作模式 */
.mode-row {
    padding: .6rem 0;
    border-top: 1px solid var(--tech-line);
}

/* 平台標籤 */
.platform-chip {
    padding: .4rem .9rem;
    font-size: .82rem;
    color: var(--tech-violet-deep);
    background: #fff;
    border: 1px solid var(--tech-line);
    border-radius: 999px;
    box-shadow: var(--tech-shadow);
}

/* 聯絡 */
.contact-list > div { padding: .4rem 0; }

/* LINE 加好友主按鈕
   狀態一律透過 Bootstrap 的 CSS 變數設定。若只寫 .btn-line:hover { color },
   Bootstrap 的 .btn:hover 會用 --bs-btn-hover-bg(預設 transparent)蓋掉背景,
   兩者權重相同,結果是白字配透明底 —— 整顆按鈕看起來空白。 */
.btn-line {
    --bs-btn-color: #fff;
    --bs-btn-bg: #06C755;                    /* LINE 品牌綠 */
    --bs-btn-border-color: #06C755;

    /* hover:灰底綠字。文字用同色相但壓暗的 #047C35,
       在 #eceff4 上對比 4.6:1(品牌綠 #06C755 只有 2.0:1,讀不清楚)。
       邊框保留品牌綠,識別度不損失。 */
    --bs-btn-hover-color: #047C35;
    --bs-btn-hover-bg: #eceff4;
    --bs-btn-hover-border-color: #06C755;

    --bs-btn-active-color: #036329;
    --bs-btn-active-bg: #e2e8ef;
    --bs-btn-active-border-color: #05a648;

    --bs-btn-focus-shadow-rgb: 6, 199, 85;

    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: .9rem 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: .75rem;
    box-shadow: 0 8px 24px -8px rgba(6, 199, 85, .75);
    transition: transform .18s ease, box-shadow .18s ease,
                background-color .18s ease, color .18s ease;
}

.btn-line:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .35);
}

.btn-line i { font-size: 1.25rem; }

.line-id {
    margin-left: .4rem;
    padding: .15rem .5rem;
    color: #047857;
    background: rgba(6, 199, 85, .1);
    border: 1px solid rgba(6, 199, 85, .3);
    border-radius: .35rem;
}

/* 聯絡方式清單 */
.contact-grid { display: grid; gap: .6rem; }

.contact-item {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--tech-line);
    border-radius: .7rem;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

a.contact-item:hover {
    color: var(--bs-body-color);
    transform: translateX(3px);
    border-color: rgba(79, 70, 229, .35);
    box-shadow: 0 8px 20px -12px rgba(79, 70, 229, .5);
}

.contact-ico {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.3rem; height: 2.3rem;
    font-size: .95rem;
    color: var(--tech-violet-deep);
    background: rgba(79, 70, 229, .08);
    border-radius: .6rem;
}

.contact-label {
    display: block;
    font-size: .68rem;
    letter-spacing: .06em;
    color: var(--bs-secondary-color);
}

@media (prefers-reduced-motion: reduce) {
    .btn-line:hover, a.contact-item:hover { transform: none; }
}

.sent-notice {
    padding: .7rem 1rem;
    color: #047857;
    background: rgba(4, 120, 87, .08);
    border: 1px solid rgba(4, 120, 87, .25);
    border-radius: .6rem;
}

/* ---------- 404 ---------- */

.err-code {
    font-size: clamp(4rem, 14vw, 7rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.05em;
    background: linear-gradient(100deg, var(--tech-cyan), var(--tech-violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: .28;
}

.err-link {
    display: block;
    padding: 1.25rem;
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

a.err-link:hover {
    color: inherit;
    transform: translateY(-3px);
    border-color: rgba(79, 70, 229, .3);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04),
                0 14px 32px -14px rgba(79, 70, 229, .35);
}

@media (prefers-reduced-motion: reduce) {
    a.err-link:hover { transform: none; }
}

/* ---------- 進場動畫 ---------- */

.reveal {
    animation: rise .55s cubic-bezier(.22, 1, .36, 1) both;
}

.reveal-1 { animation-delay: .08s; }
.reveal-2 { animation-delay: .16s; }
.reveal-3 { animation-delay: .24s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { animation: none; }
    .pulse-dot { animation: none; }
    .btn-glow:hover, .btn-ghost:hover, .btn-api:hover,
    .stat-card:hover, .feature-card:hover { transform: none; }
}
