/* ===== 錦策國際 共用樣式 ===== */
:root {
    --primary-dark: #0a1628;
    --primary-blue: #1a3a5c;
    --secondary-dark: #0d1a2d;
    --card-bg-1: #1a2a4a;
    --card-bg-2: #152238;
    --accent-orange: #ff6b35;
    --accent-yellow: #ff8c42;
    --accent-gold: #ffd700;
    --text-light: #ffffff;
    --text-muted: #a0aec0;
    --text-dim: #8899aa;
    --line-green: #06c755;
    --border-soft: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 107, 53, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft JhengHei", "PingFang TC", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background: var(--primary-dark);
    overflow-x: hidden;
}

/* ===== Header ===== */
.site-header {
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 18px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    background: rgba(10, 22, 40, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    padding: 12px 5%;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-light);
    text-decoration: none;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent-orange);
}

.nav-menu {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-orange);
    transition: width 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--accent-orange);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-cta {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 28px;
    cursor: pointer;
}

/* ===== Buttons ===== */
.cta-button {
    display: inline-block;
    padding: 16px 40px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-yellow) 50%, var(--accent-orange) 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    animation: gradientMove 4s ease infinite;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.6);
}

.cta-button.secondary {
    background: transparent;
    border: 2px solid var(--accent-orange);
    box-shadow: none;
    animation: none;
}

.cta-button.secondary:hover {
    background: var(--accent-orange);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #0d2137 100%);
    min-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 20px 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 165, 0, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 860px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    margin-bottom: 24px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    background: linear-gradient(90deg, #fff 0%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero p {
    font-size: clamp(16px, 2vw, 20px);
    color: #a0b4c8;
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Page Header (內頁) ===== */
.page-header {
    background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 100%);
    padding: 160px 20px 90px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 100%, rgba(255, 107, 53, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.page-header h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #fff 0%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.page-header p {
    font-size: 18px;
    color: var(--text-muted);
    position: relative;
}

/* ===== Sections ===== */
section {
    padding: 90px 5%;
}

.section-title {
    text-align: center;
    font-size: clamp(28px, 4vw, 38px);
    margin-bottom: 16px;
    color: var(--text-light);
    font-weight: 800;
}

.section-title span {
    color: var(--accent-orange);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 60px;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Services Grid ===== */
.services {
    background: var(--secondary-dark);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    padding: 42px 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s ease;
    border: 1px solid var(--border-soft);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-yellow));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    border-color: var(--border-hover);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    font-size: 48px;
    margin-bottom: 18px;
    display: block;
}

.service-card h3 {
    font-size: 22px;
    margin-bottom: 14px;
    color: var(--text-light);
}

.service-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.8;
}

/* ===== About / Stats ===== */
.about-section {
    background: linear-gradient(135deg, #0d2137 0%, #1a3a5c 100%);
}

.about-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    font-size: clamp(28px, 4vw, 38px);
    margin-bottom: 22px;
    color: var(--text-light);
}

.about-text h2 span {
    color: var(--accent-orange);
}

.about-text p {
    color: var(--text-muted);
    line-height: 1.9;
    font-size: 16px;
    margin-bottom: 16px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.stat-item {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
}

.stat-number {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 6px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Values ===== */
.values-section {
    background: var(--secondary-dark);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.value-card {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    padding: 36px 24px;
    border-radius: 18px;
    text-align: center;
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
}

.value-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.value-icon {
    font-size: 44px;
    margin-bottom: 16px;
}

.value-card h3 {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 19px;
}

.value-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.8;
}

/* ===== Team ===== */
.team-section {
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 100%);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
}

.team-card {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    padding: 36px 28px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
}

.team-avatar {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.35);
}

.team-card h3 {
    color: var(--text-light);
    margin-bottom: 6px;
    font-size: 20px;
}

.team-role {
    color: var(--accent-orange);
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

.team-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
}

/* ===== Portfolio ===== */
.portfolio-section {
    background: var(--secondary-dark);
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 50px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    padding: 10px 22px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: var(--text-light);
    border-color: var(--accent-orange);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
}

.portfolio-card {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    transition: all 0.4s ease;
    cursor: pointer;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

/* 分類分區標題 */
.portfolio-category {
    max-width: 1200px;
    margin: 0 auto 60px;
}
.portfolio-category:last-child {
    margin-bottom: 20px;
}
.portfolio-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 50px 0 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
    gap: 16px;
    flex-wrap: wrap;
}
.portfolio-cat-header h2 {
    font-size: clamp(22px, 3vw, 30px);
    color: var(--text-light);
    font-weight: 700;
    position: relative;
    padding-left: 16px;
}
.portfolio-cat-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(180deg, var(--accent-orange), var(--accent-yellow));
    border-radius: 2px;
}
.portfolio-cat-count {
    color: var(--text-muted);
    font-size: 14px;
    background: rgba(255, 107, 53, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* 縮圖連結 (整張可點) */
.portfolio-thumb-link {
    display: block;
    text-decoration: none;
    overflow: hidden;
    position: relative;
}
.portfolio-thumb-link::after {
    content: '🔍 點擊查看網站';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(10, 22, 40, 0.85) 100%);
    color: #fff;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}
.portfolio-card:hover .portfolio-thumb-link::after {
    opacity: 1;
}

/* 動作按鈕區 */
.portfolio-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 24px 22px;
}

.portfolio-visit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
    color: #fff;
    border: 1px solid transparent;
    border-radius: 50px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.25);
}
.portfolio-visit.secondary {
    background: rgba(255, 107, 53, 0.1);
    color: var(--accent-orange);
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: none;
}
.portfolio-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 107, 53, 0.45);
}
.portfolio-visit.secondary:hover {
    background: rgba(255, 107, 53, 0.2);
}

/* 整張卡片連結到詳細頁 */
.portfolio-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.portfolio-card-link .portfolio-info {
    transition: background 0.25s ease;
}
.portfolio-card-link:hover .portfolio-info {
    background: linear-gradient(145deg, rgba(255,107,53,0.06) 0%, transparent 100%);
}

/* ============================================ */
/* 💻 電腦螢幕外框 (Monitor mockup)              */
/* ============================================ */
.device-monitor {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.device-monitor-bezel {
    width: 100%;
    background: linear-gradient(180deg, #1f2937 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px 16px 6px 6px;
    padding: 18px 14px 28px;
    position: relative;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.device-monitor.mini .device-monitor-bezel {
    padding: 10px 10px 18px;
    border-radius: 12px 12px 4px 4px;
}

.device-monitor-camera {
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #1a1a1a;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}
.device-monitor.mini .device-monitor-camera {
    width: 4px;
    height: 4px;
    top: 4px;
}

.device-monitor-screen {
    aspect-ratio: 16 / 10;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.6);
}
.device-monitor.mini .device-monitor-screen {
    border-radius: 4px;
}

.device-monitor-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.5s ease;
}

.device-monitor:hover .device-monitor-screen img {
    transform: scale(1.04);
}

/* 高圖滾動模式:JS 加上 .has-scroll class 時生效 */
.device-monitor-screen.has-scroll img {
    width: 100%;
    height: auto;             /* 讓圖維持原比例 */
    object-fit: unset;
    object-position: unset;
    transition: transform var(--scroll-duration, 6s) cubic-bezier(0.45, 0, 0.55, 1);
    transform: translateY(0);
}

.device-monitor:hover .device-monitor-screen.has-scroll img {
    transform: scale(1) translateY(var(--scroll-shift, 0));
}

/* 手機版也要 */
.device-phone-screen.has-scroll img {
    width: 100%;
    height: auto;
    object-fit: unset;
    transition: transform var(--scroll-duration, 6s) cubic-bezier(0.45, 0, 0.55, 1);
    transform: translateY(0);
}
.device-phone:hover .device-phone-screen.has-scroll img {
    transform: translateY(var(--scroll-shift, 0));
}

/* 滾動提示徽章已隱藏(保留 hover 捲動功能,不顯示文字) */
.device-monitor-screen.has-scroll::after,
.device-phone-screen.has-scroll::after {
    content: none;
}

/* hover 螢幕反光 */
.device-monitor-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
    pointer-events: none;
}

/* 螢幕底下底座 */
.device-monitor-stand {
    margin-top: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.device-monitor-neck {
    width: 24%;
    max-width: 80px;
    height: 16px;
    background: linear-gradient(180deg, #1f2937, #111827);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top: none;
    border-radius: 0 0 6px 6px;
}
.device-monitor-base {
    width: 50%;
    max-width: 200px;
    height: 8px;
    margin-top: -1px;
    background: linear-gradient(180deg, #1f2937, #0a0f1a);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px 4px 30% 30% / 4px 4px 100% 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.device-monitor-stand.mini .device-monitor-neck {
    height: 10px;
    max-width: 50px;
}
.device-monitor-stand.mini .device-monitor-base {
    height: 5px;
    max-width: 110px;
}

/* ============================================ */
/* 📱 手機外框 (Phone mockup)                    */
/* ============================================ */
.device-phone {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

.device-phone-frame {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 9 / 19;
    background: linear-gradient(145deg, #1f2937 0%, #0a0f1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 38px;
    padding: 10px;
    position: relative;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.device-phone-notch {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 24px;
    background: #000;
    border-radius: 14px;
    z-index: 2;
}

.device-phone-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 35%;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    z-index: 2;
}

.device-phone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
}

.device-phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* 設備標籤 */
.device-label {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

/* ============================================ */
/* 作品詳細頁雙設備呈現                          */
/* ============================================ */
.portfolio-detail-devices {
    padding: 60px 5% 40px;
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 100%);
}
.devices-wrap {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 60px;
    align-items: end;
}
.devices-wrap .device-monitor,
.devices-wrap .device-phone {
    animation: deviceIn 0.7s ease both;
}
.devices-wrap .device-phone {
    animation-delay: 0.15s;
}

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

.portfolio-detail-content {
    padding: 70px 5% 40px;
    max-width: 820px;
    margin: 0 auto;
}

.portfolio-detail-meta {
    background: var(--secondary-dark);
    padding: 50px 5%;
}
.meta-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.meta-item {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border: 1px solid var(--border-soft);
    padding: 22px 24px;
    border-radius: 14px;
}
.meta-label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.meta-value {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
    word-break: break-all;
}
.meta-link {
    color: var(--accent-orange);
    text-decoration: none;
}
.meta-link:hover { text-decoration: underline; }

.portfolio-detail .page-header h1 {
    margin-top: 18px;
}
.portfolio-detail .portfolio-tag {
    display: inline-block;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .devices-wrap {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .device-phone-frame {
        max-width: 240px;
    }
    .device-phone-frame {
        margin: 0 auto;
    }
}

.portfolio-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
    overflow: hidden;
}

.portfolio-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 107, 53, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-thumb::after {
    opacity: 1;
}

.portfolio-info {
    padding: 24px;
}

.portfolio-tag {
    display: inline-block;
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-orange);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.portfolio-card h3 {
    color: var(--text-light);
    margin-bottom: 8px;
    font-size: 19px;
}

.portfolio-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
}

/* ===== Contact ===== */
.contact-section {
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 100%);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 50px;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-info h2 {
    color: var(--text-light);
    font-size: 28px;
    margin-bottom: 18px;
}

.contact-info > p {
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.8;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
    padding: 20px 22px;
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 左側漸層條(hover 時滑入) */
.contact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-orange) 0%, var(--accent-yellow) 100%);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.35s ease;
}

.contact-item:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.contact-item:hover::before {
    transform: scaleY(1);
}

.contact-item-icon {
    font-size: 26px;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.22), rgba(255, 140, 66, 0.08));
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

.contact-item:hover .contact-item-icon {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.35), rgba(255, 140, 66, 0.15));
    transform: scale(1.05);
}

.contact-item-text {
    flex: 1;
    min-width: 0;
}

.contact-item-text strong {
    display: block;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.contact-item-text span {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
    word-break: break-all;
}

/* 可點連結 — 強制蓋過瀏覽器預設 (link/visited/hover) */
.contact-item-text a,
.contact-item-text a:link,
.contact-item-text a:visited {
    color: #ff8c42 !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 140, 66, 0.4);
    padding-bottom: 2px;
    transition: all 0.2s ease;
    word-break: break-all;
    display: inline-block;
}

.contact-item-text a:hover,
.contact-item-text a:focus,
.contact-item-text a:active {
    color: #ffd700 !important;
    border-bottom-color: #ffd700;
    border-bottom-style: solid;
}

.contact-form {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    padding: 36px;
    border-radius: 20px;
    border: 1px solid var(--border-soft);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-light);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 13px 16px;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-orange);
    background: rgba(10, 22, 40, 0.85);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-submit {
    width: 100%;
    margin-top: 10px;
    border: none;
    font-family: inherit;
}

/* ===== CTA banner ===== */
.cta-banner {
    background: linear-gradient(135deg, #0d2137 0%, #1a3a5c 100%);
    text-align: center;
    padding: 80px 5%;
}

.cta-banner h2 {
    color: var(--text-light);
    font-size: clamp(26px, 4vw, 36px);
    margin-bottom: 16px;
}

.cta-banner p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 16px;
}

/* ===== Footer ===== */
footer {
    background: #07101e;
    padding: 60px 5% 24px;
    color: var(--text-dim);
    border-top: 1px solid var(--border-soft);
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 18px;
}

.footer-col p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 8px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-col ul a:hover {
    color: var(--accent-orange);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-soft);
    text-align: center;
    font-size: 13px;
}

/* ===== Floating buttons ===== */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 58px;
    height: 58px;
    background: var(--line-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(6, 199, 85, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 99;
    text-decoration: none;
}

.fab:hover {
    transform: scale(1.1);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 48px;
    height: 48px;
    background: var(--accent-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 99;
    text-decoration: none;
    border: none;
}

.back-to-top.visible {
    opacity: 0.9;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Skip link (accessibility) ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-orange);
    color: #fff;
    padding: 12px 22px;
    text-decoration: none;
    z-index: 2000;
    border-radius: 0 0 8px 0;
    font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    max-width: 1200px;
    margin: 0 auto 24px;
    font-size: 14px;
}
.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    justify-content: center;
}
.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}
.breadcrumbs li:not(:last-child)::after {
    content: '/';
    color: var(--text-dim);
    margin-left: 8px;
}
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumbs a:hover { color: var(--accent-orange); }
.breadcrumbs [aria-current="page"] {
    color: var(--text-light);
    font-weight: 500;
}

/* ===== Image-in-emoji-container overrides ===== */
.service-icon img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
    display: inline-block;
    vertical-align: middle;
}

.portfolio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.blog-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-cover-large.has-image {
    font-size: 0;
    overflow: hidden;
    padding: 0;
}

.post-cover-large.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 16px 0;
}

/* ===== Blog ===== */
.blog-section {
    background: var(--secondary-dark);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    transition: all 0.4s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.blog-cover {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}

.blog-info {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-info h3 {
    color: var(--text-light);
    margin: 12px 0 10px;
    font-size: 20px;
    line-height: 1.4;
}

.blog-info p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
    flex: 1;
}

.blog-meta {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-dim);
    font-size: 13px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.blog-section {
    padding: 70px 5%;
}

/* ===== Single Post ===== */
.post-article {
    max-width: 820px;
    margin: 0 auto;
    padding: 150px 5% 80px;
}

.post-header {
    text-align: center;
    margin-bottom: 40px;
}

.post-header h1 {
    font-size: clamp(28px, 4vw, 42px);
    margin: 20px 0 16px;
    color: var(--text-light);
    line-height: 1.3;
}

.post-meta {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.post-tag {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-orange);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.post-cover-large {
    aspect-ratio: 16/8;
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    margin-bottom: 40px;
}

.post-body {
    color: #d6e3f1;
    font-size: 17px;
    line-height: 1.9;
}

.post-body h2 {
    color: var(--text-light);
    font-size: 26px;
    margin: 40px 0 16px;
}

.post-body h3 {
    color: var(--text-light);
    font-size: 21px;
    margin: 32px 0 12px;
}

.post-body p {
    margin-bottom: 18px;
}

.post-body ul, .post-body ol {
    margin: 0 0 18px 22px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body a {
    color: var(--accent-orange);
    text-decoration: underline;
}

.post-body code {
    background: rgba(255, 107, 53, 0.12);
    color: #ffb89a;
    padding: 2px 8px;
    border-radius: 5px;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 0.92em;
}

.post-body pre {
    background: #0a1628;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 18px;
    overflow-x: auto;
    margin: 0 0 18px;
}

.post-body pre code {
    background: transparent;
    color: #d6e3f1;
    padding: 0;
}

.post-body blockquote {
    border-left: 4px solid var(--accent-orange);
    padding: 4px 0 4px 18px;
    color: var(--text-muted);
    font-style: italic;
    margin: 0 0 18px;
}

.post-body strong {
    color: var(--text-light);
}

.post-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.7;
    margin: 16px 0 22px;
    font-style: italic;
    border-left: 3px solid var(--accent-orange);
    padding-left: 16px;
    text-align: left;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.post-meta .post-modified {
    color: var(--accent-orange);
}

.post-meta .reading-time,
.post-meta .word-count {
    background: rgba(255, 107, 53, 0.12);
    color: var(--accent-orange);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.post-tags {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* ===== TOC ===== */
.post-toc {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 22px 26px;
    margin: 36px 0;
}
.post-toc h2 {
    font-size: 18px;
    margin: 0 0 14px;
    color: var(--text-light);
    padding: 0;
    border: none;
}
.post-toc ol {
    list-style: none;
    counter-reset: toc;
    margin: 0;
    padding: 0;
}
.post-toc li {
    counter-increment: toc;
    margin-bottom: 8px;
    line-height: 1.5;
}
.post-toc li::before {
    content: counter(toc) '. ';
    color: var(--accent-orange);
    margin-right: 6px;
    font-weight: 600;
}
.post-toc .toc-h3 {
    margin-left: 22px;
    font-size: 14px;
}
.post-toc a {
    color: var(--text-muted);
    text-decoration: none;
}
.post-toc a:hover {
    color: var(--accent-orange);
}

/* ===== Process Flow Infographic (合作流程圖案化) ===== */
.process-section {
    background:
        radial-gradient(ellipse at top, rgba(255, 107, 53, 0.08), transparent 60%),
        linear-gradient(135deg, #0a1628 0%, #0d2137 100%);
    position: relative;
    overflow: hidden;
    padding-top: 100px;
    padding-bottom: 100px;
}

.process-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    opacity: 0.6;
}

.process-flow {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(var(--total-steps, 6), 1fr);
    gap: 0;
    position: relative;
    z-index: 1;
}

.process-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 14px;
}

/* 大圓形圖示 */
.process-icon-circle {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border: 2px solid rgba(255, 107, 53, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 26px;
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 3;
}

/* 圓圈裡的橘色光暈(放在圖示下層) */
.process-icon-glow {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: conic-gradient(from 180deg at 50% 50%,
        rgba(255, 107, 53, 0) 0deg,
        rgba(255, 107, 53, 0.5) 90deg,
        rgba(255, 140, 66, 0.5) 180deg,
        rgba(255, 107, 53, 0) 270deg,
        rgba(255, 107, 53, 0) 360deg);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    filter: blur(8px);
}

.process-icon-emoji {
    font-size: 48px;
    line-height: 1;
    display: block;
    z-index: 2;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 編號 badge */
.process-num-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-yellow) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.45);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
    z-index: 4;
}

/* 連接線(箭頭風格) */
.process-node:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 55px;  /* 圓心位置 */
    left: calc(50% + 60px);
    right: calc(-50% + 60px);
    height: 2px;
    background-image: linear-gradient(90deg, rgba(255, 107, 53, 0.5) 50%, transparent 0);
    background-size: 14px 2px;
    background-repeat: repeat-x;
    z-index: 1;
}

/* 箭頭尖端 */
.process-node:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 50px;
    right: calc(-50% + 56px);
    width: 0;
    height: 0;
    border-left: 8px solid rgba(255, 107, 53, 0.7);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    z-index: 2;
}

/* hover 效果 */
.process-node:hover .process-icon-circle {
    transform: translateY(-6px) scale(1.05);
    border-color: var(--accent-orange);
}
.process-node:hover .process-icon-glow {
    opacity: 1;
    animation: spinGlow 4s linear infinite;
}
.process-node:hover .process-icon-emoji {
    transform: scale(1.15) rotate(-6deg);
}

@keyframes spinGlow {
    to { transform: rotate(360deg); }
}

/* 標題 + 說明文字 */
.process-node-text {
    max-width: 220px;
}
.process-node-text h3 {
    color: var(--text-light);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
}
.process-node-text p {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
}

/* 平板 - 3 欄,連接線改 row(同 row 之間有線,跨 row 不畫) */
@media (max-width: 1024px) {
    .process-flow {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 50px;
    }
    /* 每 3 個就斷線 */
    .process-node:nth-child(3n):not(:last-child)::after,
    .process-node:nth-child(3n):not(:last-child)::before {
        display: none;
    }
}

/* 平板小 - 2 欄 */
@media (max-width: 700px) {
    .process-flow {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 50px;
    }
    .process-node:nth-child(3n):not(:last-child)::after,
    .process-node:nth-child(3n):not(:last-child)::before { display: block; }
    .process-node:nth-child(2n):not(:last-child)::after,
    .process-node:nth-child(2n):not(:last-child)::before {
        display: none;
    }
}

/* 手機 - 1 欄,連接線改直向 */
@media (max-width: 480px) {
    .process-flow {
        grid-template-columns: 1fr;
        row-gap: 60px;
    }
    .process-node:nth-child(3n):not(:last-child)::after,
    .process-node:nth-child(2n):not(:last-child)::after,
    .process-node:nth-child(3n):not(:last-child)::before,
    .process-node:nth-child(2n):not(:last-child)::before { display: block; }
    .process-node:not(:last-child)::after {
        top: auto;
        bottom: -42px;
        left: 50%;
        right: auto;
        width: 2px;
        height: 30px;
        background-image: linear-gradient(180deg, rgba(255, 107, 53, 0.5) 50%, transparent 0);
        background-size: 2px 8px;
        background-repeat: repeat-y;
        transform: translateX(-50%);
    }
    .process-node:not(:last-child)::before {
        top: auto;
        bottom: -16px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 8px solid rgba(255, 107, 53, 0.7);
        border-bottom: none;
    }
}

/* ===== FAQ ===== */
.faq-section {
    background: var(--secondary-dark);
}

.faq-list {
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.faq-item {
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.25s ease;
}

.faq-item[open] {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    color: var(--text-light);
    font-weight: 600;
    font-size: 17px;
    list-style: none;
    gap: 16px;
    user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-q { flex: 1; line-height: 1.5; }

.faq-toggle {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-orange);
    border-radius: 50%;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    transition: transform 0.25s ease;
}

.faq-item[open] .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 24px 22px;
    color: var(--text-dim);
    line-height: 1.9;
    font-size: 15px;
}

.faq-answer p { margin-bottom: 10px; }
.faq-answer ul, .faq-answer ol { margin: 0 0 10px 22px; }
.faq-answer a { color: var(--accent-orange); }

/* Post-level FAQ section */
.post-faq {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid var(--border-soft);
}

.post-faq h2 {
    color: var(--text-light);
    font-size: 24px;
    margin-bottom: 22px;
}

/* ===== Related posts ===== */
.related-posts {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-soft);
}
.related-posts h2 {
    color: var(--text-light);
    font-size: 22px;
    margin-bottom: 22px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.related-card {
    display: block;
    background: linear-gradient(145deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}
.related-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.related-cover {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2137 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    overflow: hidden;
}
.related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-info {
    padding: 16px;
}
.related-info h3 {
    color: var(--text-light);
    font-size: 16px;
    margin: 8px 0 6px;
    line-height: 1.4;
}
.related-info p {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .about-content,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 22, 40, 0.98);
        padding: 24px;
        gap: 20px;
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        backdrop-filter: blur(10px);
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    .menu-toggle {
        display: block;
    }

    section {
        padding: 70px 5%;
    }

    .hero {
        padding: 120px 20px 70px;
    }

    .page-header {
        padding: 130px 20px 70px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .contact-form {
        padding: 26px 22px;
    }
}

/* ============================================================ */
/* 📱 手機版專屬調整(不影響電腦版,放最後確保覆蓋優先級高)    */
/* ============================================================ */
@media (max-width: 768px) {

    /* ---- 漢堡按鈕靠右 ---- */
    .menu-toggle {
        margin-left: auto;
        margin-right: 0;
        padding: 4px 8px;
    }
    .primary-nav { flex: 0 0 auto; }

    /* ---- 服務項目強制 2 欄 ---- */
    .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px;
    }
    .service-card {
        padding: 26px 14px 22px;
    }
    .service-icon {
        font-size: 38px;
        margin-bottom: 12px;
    }
    .service-card h3 {
        font-size: 15.5px;
        margin-bottom: 10px;
    }
    .service-card p {
        font-size: 12.5px;
        line-height: 1.65;
    }

    /* ---- 關於 - 核心價值 + 團隊 強制 2 欄 ---- */
    .values-grid,
    .team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px;
    }
    .value-card {
        padding: 22px 14px;
    }
    .value-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }
    .value-card h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    .value-card p {
        font-size: 12.5px;
        line-height: 1.65;
    }
    .team-card {
        padding: 22px 14px;
    }
    .team-avatar {
        width: 80px;
        height: 80px;
        font-size: 38px;
        margin-bottom: 14px;
    }
    .team-card h3 {
        font-size: 15.5px;
    }
    .team-role {
        font-size: 12px;
    }
    .team-card p {
        font-size: 12px;
        line-height: 1.6;
    }

    /* ---- 合作流程 — 縮小 + 迴轉動畫 ---- */
    .process-flow {
        grid-template-columns: repeat(2, 1fr) !important;
        row-gap: 36px;
        column-gap: 12px;
        padding: 0 4%;
    }
    .process-node {
        padding: 0 4px;
    }
    .process-icon-circle {
        width: 78px;
        height: 78px;
        margin-bottom: 16px;
        border-width: 2px;
    }
    .process-icon-emoji {
        font-size: 32px;
    }
    .process-num-badge {
        width: 28px;
        height: 28px;
        font-size: 11px;
        top: -4px;
        right: -4px;
    }
    .process-node-text h3 {
        font-size: 14.5px;
        margin-bottom: 6px;
    }
    .process-node-text p {
        font-size: 11.5px;
        line-height: 1.55;
    }

    /* 連續迴轉動畫 - 奇偶輪流轉動,營造律動感 */
    .process-node:nth-child(odd) .process-icon-circle {
        animation: processSwingLeft 5s ease-in-out infinite;
    }
    .process-node:nth-child(even) .process-icon-circle {
        animation: processSwingRight 5s ease-in-out infinite;
    }
    .process-node:hover .process-icon-circle {
        animation-play-state: paused;
    }
    @keyframes processSwingLeft {
        0%, 100% { transform: rotate(-6deg) translateY(0); }
        50%      { transform: rotate(6deg) translateY(-3px); }
    }
    @keyframes processSwingRight {
        0%, 100% { transform: rotate(6deg) translateY(0); }
        50%      { transform: rotate(-6deg) translateY(-3px); }
    }
    /* emoji 反向旋轉中和讓圖示永遠正立(只是圓圈在轉) */
    .process-node:nth-child(odd) .process-icon-emoji {
        animation: emojiSpinCancelL 5s ease-in-out infinite;
    }
    .process-node:nth-child(even) .process-icon-emoji {
        animation: emojiSpinCancelR 5s ease-in-out infinite;
    }
    @keyframes emojiSpinCancelL {
        0%, 100% { transform: rotate(6deg); }
        50%      { transform: rotate(-6deg); }
    }
    @keyframes emojiSpinCancelR {
        0%, 100% { transform: rotate(-6deg); }
        50%      { transform: rotate(6deg); }
    }

    /* 全面隱藏所有箭頭(等下只開 odd-row 那條) */
    .process-node::after,
    .process-node::before {
        display: none !important;
    }
    /* 只給「左欄(odd)且不是最後一個」加橫向虛線箭頭 */
    .process-node:nth-child(odd):not(:last-child)::after {
        content: '';
        display: block !important;
        position: absolute;
        top: 38px;
        bottom: auto;
        right: -8px;
        left: calc(50% + 42px);
        width: auto;
        height: 2px;
        background-image: linear-gradient(90deg, rgba(255, 107, 53, 0.7) 50%, transparent 0);
        background-size: 10px 2px;
        background-repeat: repeat-x;
        transform: none;
        border: none;
        z-index: 1;
    }
    .process-node:nth-child(odd):not(:last-child)::before {
        content: '';
        display: block !important;
        position: absolute;
        top: 33px;
        bottom: auto;
        right: -14px;
        left: auto;
        width: 0;
        height: 0;
        border-left: 8px solid rgba(255, 107, 53, 0.85);
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-right: none;
        background: none;
        transform: none;
        z-index: 2;
    }
}

/* ============================================ */

/* ============================================ */
/* App 作品集 — Clean showcase style              */
/* ============================================ */

/* App grid: cards stay normal size, never stretch full width */
.portfolio-grid.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
    gap: 32px;
    justify-content: center;
}

/* The card itself — clean card around the showcase */
.portfolio-card.app-showcase-card {
    background: #0f1d33;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.portfolio-card.app-showcase-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 107, 53, 0.35);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,107,53,0.15);
}

/* Showcase area: gradient backdrop + huge icon */
.app-showcase {
    position: relative;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
}
.app-showcase-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(255,107,53,0.18) 0%, transparent 55%),
        radial-gradient(circle at 75% 80%, rgba(80,130,255,0.22) 0%, transparent 55%),
        linear-gradient(135deg, #0a1628 0%, #142545 50%, #0a1628 100%);
}
.app-showcase-bg::after {
    /* subtle dot pattern */
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.6;
}
.app-showcase-icon {
    position: relative;
    z-index: 1;
    width: 150px !important;
    height: 150px !important;
    border-radius: 32px;
    object-fit: cover;
    box-shadow:
        0 24px 50px rgba(0,0,0,0.55),
        0 8px 20px rgba(0,0,0,0.35),
        0 0 0 1px rgba(255,255,255,0.08),
        inset 0 1px 0 rgba(255,255,255,0.12);
    transition: transform 0.35s ease;
}
.portfolio-card.app-showcase-card:hover .app-showcase-icon {
    transform: scale(1.04) rotate(-2deg);
}

/* Platform badge (top right) */
.app-platform-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    padding: 5px 12px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
}
.app-platform-badge.large {
    font-size: 13px;
    padding: 7px 16px;
}

/* App Store action button in card */
.portfolio-visit.appstore-btn {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.18);
}
.portfolio-visit.appstore-btn:hover {
    background: #1a1a1a !important;
    border-color: rgba(255,255,255,0.3);
}

/* ============================================ */
/* App detail page hero                          */
/* ============================================ */
.app-hero-section {
    padding: 70px 5% 50px;
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 100%);
}
.app-hero-wrap {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    aspect-ratio: 16 / 10;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 50px 30px;
    isolation: isolate;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.app-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(255,107,53,0.22) 0%, transparent 55%),
        radial-gradient(circle at 75% 75%, rgba(80,130,255,0.28) 0%, transparent 55%),
        linear-gradient(135deg, #0e1d36 0%, #16294a 50%, #0a1628 100%);
}
.app-hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 22px 22px;
}
.app-hero-icon {
    position: relative;
    z-index: 1;
    width: 200px !important;
    height: 200px !important;
    border-radius: 44px;
    object-fit: cover;
    box-shadow:
        0 32px 70px rgba(0,0,0,0.6),
        0 12px 28px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255,255,255,0.08),
        inset 0 1px 0 rgba(255,255,255,0.15);
}
.app-hero-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.app-hero-meta .app-platform-badge {
    position: static;
}

/* Apple-style App Store badge */
.app-store-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #000;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: #fff !important;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    line-height: 1.1;
}
.app-store-badge-link:hover {
    transform: translateY(-2px);
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.35);
}
.app-store-badge-link svg { flex-shrink: 0; }
.app-store-badge-link span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.app-store-badge-link small {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.3px;
}
.app-store-badge-link strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* CTA in hero — make App Store CTA black */
.cta-button.appstore-cta {
    background: #000;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
}
.cta-button.appstore-cta:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
}

/* RWD */
@media (max-width: 768px) {
    .portfolio-grid.app-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .app-showcase-icon {
        width: 120px !important;
        height: 120px !important;
        border-radius: 26px;
    }
    .app-hero-wrap {
        aspect-ratio: auto;
        padding: 40px 24px;
        border-radius: 24px;
    }
    .app-hero-icon {
        width: 150px !important;
        height: 150px !important;
        border-radius: 34px;
    }
}
