/* 傑笙真空科技 官網樣式
   設計語言與 jasonvtnew/assets/css/app.css 共用同一套色票（薰衣草藍主色），
   讓公開官網跟系統登入之後的介面風格一致。實際色碼定義以 app.css 的 :root 為準，
   這裡是官網行銷頁面需要的獨立樣式，不共用 app.css 整份檔案（避免拉進管理介面
   專用的表格／表單樣式）。
*/

:root {
    --bg: #eef2f8;
    --panel: #ffffff;
    --text: #1c2836;
    --muted: #5b6b81;
    --line: #dbe2ec;
    --accent: #5e6ad2;
    --accent-2: #4a52b0;
    --accent-soft: #eef0fb;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(24, 39, 56, 0.05), 0 1px 1px rgba(24, 39, 56, 0.04);
    --shadow: 0 6px 20px rgba(24, 39, 56, 0.08), 0 1px 3px rgba(24, 39, 56, 0.05);
    --shadow-lg: 0 20px 48px rgba(24, 39, 56, 0.16), 0 4px 10px rgba(24, 39, 56, 0.06);
    --font: "Inter", "Noto Sans TC", "Segoe UI", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 5px 12px;
    border-radius: 999px;
}

/* 導覽列 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 800; letter-spacing: -0.02em;
    flex-shrink: 0;
}
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    width: 40px;
    height: 40px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    position: relative;
    transition: transform 150ms ease;
}
.nav-toggle span::before { content: ''; position: absolute; top: -6px; }
.nav-toggle span::after { content: ''; position: absolute; top: 6px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    font-size: 14px;
    font-weight: 500;
}
.nav-links a { color: var(--muted); transition: color 120ms ease; }
.nav-links a:hover { color: var(--text); }
.nav-links a.highlight {
    background: var(--accent);
    color: #fff;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(94, 106, 210, 0.28);
}
.nav-links a.highlight:hover { background: var(--accent-2); color: #fff; }
.nav-links .partner { color: #2a78d6; }

/* Hero */
.hero {
    position: relative;
    padding: 88px 0 64px;
    overflow: hidden;
    background: linear-gradient(180deg, #f4f6fb 0%, var(--bg) 100%);
}
.hero::before {
    content: '';
    position: absolute;
    top: -180px; right: -160px;
    width: 640px; height: 640px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 106, 210, 0.16), transparent 65%);
    pointer-events: none;
}
.hero .container {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
}
.hero h1 {
    font-size: 36px;
    line-height: 1.32;
    letter-spacing: -0.02em;
    margin: 18px 0 20px;
}
.hero h1 .accent { color: var(--accent); }
.hero p {
    color: var(--muted);
    font-size: 15.5px;
    margin: 0;
}
.hero-art { position: relative; }
.hero-art img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* 一般 section */
.section { padding: 72px 0; }
.section-alt { background: var(--panel); }
.section-head {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 44px;
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 {
    font-size: 27px;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}
.section-head p {
    color: var(--muted);
    font-size: 15px;
    margin: 0;
}

/* 服務項目卡片 */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 30px 24px;
    text-align: center;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c9d0f5; }
.card .icon-badge {
    width: 56px; height: 56px;
    margin: 0 auto 18px;
    border-radius: 14px;
    background: var(--accent-soft);
    display: flex; align-items: center; justify-content: center;
}
.card .icon-badge img { width: 28px; height: 28px; }
.card h3 { font-size: 16px; margin: 0 0 8px; letter-spacing: -0.005em; }
.card p { font-size: 13.5px; color: var(--muted); margin: 0; }

/* 維修實例 */
.example-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.example-card {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform 180ms ease, box-shadow 180ms ease;
}
.example-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.example-card .thumb {
    aspect-ratio: 4 / 3;
    background: #f4f6fb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.example-card .thumb img { max-height: 100%; object-fit: contain; transition: transform 250ms ease; }
.example-card:hover .thumb img { transform: scale(1.06); }
.example-card .label {
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    border-top: 1px solid var(--line);
}

/* Footer */
.site-footer {
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
    .hero .container { grid-template-columns: 1fr; }
    .hero-art { order: -1; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .example-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 24px 20px;
        display: none;
        box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 10px 0; width: 100%; }
    .hero { padding: 48px 0 40px; }
    .hero h1 { font-size: 27px; margin-top: 14px; }
}

@media (max-width: 520px) {
    .grid { grid-template-columns: 1fr; }
    .example-grid { grid-template-columns: 1fr 1fr; }
}

/* 型號詳情頁／聯絡頁共用的頁首橫幅 */
.detail-hero {
    position: relative;
    padding: 60px 0 44px;
    text-align: center;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
}
.detail-hero::before {
    content: '';
    position: absolute;
    top: -140px; left: -100px;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
}
.detail-hero .container { position: relative; }
.detail-hero .eyebrow { background: rgba(255, 255, 255, 0.18); color: #fff; margin-bottom: 12px; }
.detail-hero h1 {
    font-size: 27px;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}
.detail-hero p {
    margin: 0;
    opacity: 0.9;
    font-size: 14.5px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    margin-top: 28px;
}

.detail-grid { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .detail-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .detail-grid { grid-template-columns: repeat(2, 1fr); } }

/* 聯絡頁 */
.contact-info { grid-template-columns: repeat(3, 1fr); margin-bottom: 48px; }
.contact-info .card { text-align: left; padding: 24px; }
.contact-info .card .icon-badge { margin: 0 0 14px; }
.contact-info .card h3 { font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.contact-info .card p { margin: 0; font-size: 15px; }

.contact-form-wrap {
    max-width: 680px;
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 36px;
}
.contact-form-wrap h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.01em; }
.contact-form-wrap .form-note { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row-full { margin-bottom: 16px; }
.form-row label, .form-row-full label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-row input,
.form-row-full input,
.form-row-full select,
.form-row-full textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.form-row input:focus,
.form-row-full select:focus,
.form-row-full textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.13);
}
.form-submit { text-align: center; margin-top: 8px; }
.form-submit button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 34px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(94, 106, 210, 0.28);
    transition: background 120ms ease, transform 120ms ease;
}
.form-submit button:hover { background: var(--accent-2); transform: translateY(-1px); }

@media (max-width: 720px) {
    .contact-info { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* AI 助手浮動小工具 */
.ai-chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 200; }
.ai-chat-toggle {
    width: 58px; height: 58px; border-radius: 50%;
    background: var(--accent); color: #fff; border: none;
    box-shadow: 0 10px 26px rgba(94, 106, 210, 0.4);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform 180ms ease, background 180ms ease;
    position: relative;
}
.ai-chat-toggle:hover { background: var(--accent-2); transform: translateY(-2px) scale(1.03); }
.ai-chat-toggle .icon-close { display: none; }
.ai-chat-toggle.active .icon-chat { display: none; }
.ai-chat-toggle.active .icon-close { display: block; }

.ai-chat-panel {
    position: absolute;
    right: 0; bottom: 72px;
    width: 336px; max-width: calc(100vw - 40px);
    height: 460px; max-height: calc(100vh - 130px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: aiChatPop 180ms ease;
}
@keyframes aiChatPop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-chat-head {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #fff;
    padding: 14px 16px;
    display: flex; align-items: center; gap: 10px;
}
.ai-chat-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; letter-spacing: -0.01em;
    flex-shrink: 0;
}
.ai-chat-title { font-weight: 700; font-size: 14.5px; }
.ai-chat-sub { font-size: 11.5px; opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.ai-chat-sub .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; display: inline-block; }

.ai-chat-log {
    flex: 1; overflow-y: auto;
    padding: 16px; display: flex; flex-direction: column; gap: 10px;
    background: #f7f8fb;
}
.ai-chat-msg {
    max-width: 88%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-chat-msg.bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.ai-chat-msg.bot.thinking { color: var(--muted); font-style: italic; }
.ai-chat-msg.bot.error { border-color: #f3c8c3; background: #fdecea; color: #a3382c; }
.ai-chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-chat-form {
    padding: 10px;
    border-top: 1px solid var(--line);
    background: #fff;
}
.ai-chat-form #aiChatName {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 12px;
    color: var(--muted);
    padding: 4px 6px 8px;
    font-family: var(--font);
}
.ai-chat-form #aiChatName:focus { outline: none; color: var(--text); }
.ai-chat-form-row { display: flex; gap: 8px; }
.ai-chat-form-row input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-family: var(--font);
}
.ai-chat-form-row input:focus { outline: none; border-color: var(--accent); }
.ai-chat-form-row button {
    width: 38px; height: 38px; flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 120ms ease;
}
.ai-chat-form-row button:hover { background: var(--accent-2); }

@media (max-width: 480px) {
    .ai-chat-panel { width: calc(100vw - 24px); right: -10px; }
}

/* 客戶維修查詢結果（modules/customer/index.php?view=portal） */
.cs-alert {
    max-width: 680px;
    margin: 0 auto;
    background: #fdecea;
    border: 1px solid #f3c8c3;
    color: #a3382c;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 14px;
    text-align: center;
}
.cs-result-grid { display: flex; flex-direction: column; gap: 16px; max-width: 780px; margin: 0 auto; }
.cs-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
}
.cs-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.cs-card-code { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.cs-card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-family: monospace; }
.cs-badge {
    flex-shrink: 0;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    white-space: nowrap;
}
.cs-badge.done { background: #eaf7f0; color: #227a56; }
.cs-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 24px;
}
.cs-label { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.cs-value { display: block; font-size: 14.5px; }

@media (max-width: 560px) {
    .cs-card-grid { grid-template-columns: 1fr; }
}

/* 技術文件查詢庫 */
.tech-doc-group { max-width: 780px; margin: 0 auto 40px; }
.tech-doc-cat {
    font-size: 18px;
    letter-spacing: -0.01em;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-soft);
}
.tech-doc-list { display: flex; flex-direction: column; gap: 10px; }
.tech-doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    color: var(--text);
    transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.tech-doc-item svg { color: var(--accent); flex-shrink: 0; }
.tech-doc-item:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text); transform: translateX(2px); }
.tech-doc-item span { font-size: 14.5px; }

/* PUMP 故障碼查詢 */
.fc-search-form {
    max-width: 780px;
    margin: 0 auto 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.fc-search-form input[type="text"] {
    flex: 1 1 260px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    background: var(--panel);
    color: var(--text);
}
.fc-search-form select {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    background: var(--panel);
    color: var(--text);
}
.fc-search-form button {
    padding: 12px 22px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 120ms ease;
}
.fc-search-form button:hover { opacity: 0.9; }
.fc-hint, .fc-count {
    max-width: 780px;
    margin: 0 auto 20px;
    font-size: 13.5px;
    color: var(--muted);
}
.fc-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.fc-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
}
.fc-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.fc-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 3px 10px;
    border-radius: 6px;
}
.fc-series { font-size: 12.5px; color: var(--muted); }
.fc-advisory { font-size: 13.5px; color: var(--muted); margin: 0 0 6px; }
.fc-meaning { font-size: 14.5px; line-height: 1.7; margin: 0; white-space: pre-line; }
.fc-advisory img, .fc-meaning img { max-width: 320px; width: 100%; height: auto; border-radius: 8px; margin: 8px 0; display: block; border: 1px solid var(--line); }
.fc-pagination {
    max-width: 780px;
    margin: 24px auto 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.fc-pagination a {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text);
}
.fc-pagination a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fc-pagination a:hover { border-color: var(--accent); }
