/* =========================================
   1. 變數系統 (Nippon Colors: Sora Edition)
   ========================================= */
:root {
  /* --- 配色系統 --- */
  --primary: #58B2DC; 
  --primary-light: #A5DEE4; 
  --primary-dark: #1E88A8; 
  --text-main: #333333;
  --text-body: #5F6569;
  --text-muted: #949495;
  --bg-page: #FCFCFA;
  --bg-white: #FFFFFF;
  --border: #E6E6E6;
  
  /* --- 陰影與圓角 --- */
  --shadow-sm: 0 2px 8px rgba(88, 178, 220, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 40px rgba(88, 178, 220, 0.12);
  --header-height: 80px;
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 12px;

  /* --- 字體 --- */
  --font-serif: 'Shippori Mincho', 'Noto Serif TC', serif;
  --font-sans: 'Noto Sans TC', sans-serif;
}

/* =========================================
   2. 全局設定
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-body);
  background-color: var(--bg-page);
  line-height: 1.8;
  letter-spacing: 0.05em;
  -webkit-font-smoothing: antialiased;
    width: 100%;
  overflow-x: hidden; /* 強制隱藏水平超出的部分 */
}

h1, h2, h3, h4 {
  margin-top: 0; color: var(--text-main);
  font-family: var(--font-serif); font-weight: 600;
  line-height: 1.4; letter-spacing: 0.08em;
}

a { text-decoration: none; color: inherit; transition: 0.4s ease; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1080px; margin: 0 auto; padding: 0 32px; width: 100%;
}

/* =========================================
   3. 元件：按鈕
   ========================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px; font-weight: 500; border-radius: var(--radius-md);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer; font-size: 15px; border: 1px solid transparent;
  letter-spacing: 0.1em; font-family: var(--font-sans);
}
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 4px 12px rgba(88, 178, 220, 0.3);
}
.btn-primary:hover {
  background: var(--primary-dark); transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(88, 178, 220, 0.4);
}
.btn-outline {
  background: transparent; color: var(--primary); border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary); color: white;
}
.btn-lg { padding: 16px 40px; font-size: 16px; }
.btn-full { width: 100%; }

/* =========================================
   4. 導覽列
   ========================================= */
.navbar {
  position: sticky; top: 0; z-index: 100; height: var(--header-height);
  background: rgba(252, 252, 250, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.03); display: flex; align-items: center;
}
.nav-container { display: flex; align-items: center; justify-content: space-between; }

.brand .logo-link { display: flex; align-items: center; gap: 12px; }
.brand .logo-img {
  width: 36px; height: 36px; border-radius: 4px; overflow: hidden; background: var(--primary);
}
.brand-name { 
  font-size: 18px; font-weight: 600; color: var(--text-main); font-family: var(--font-serif);
}

.desktop-nav ul { display: flex; gap: 40px; }
.desktop-nav a { 
  font-weight: 400; font-size: 15px; color: var(--text-body);
  position: relative; padding: 4px 0;
}
.desktop-nav a:hover { color: var(--primary); }
.desktop-nav a.active-menu { color: var(--primary); font-weight: 500; }
.desktop-nav a.active-menu::after {
  content: ''; position: absolute; bottom: -2px; left: 50%;
  transform: translateX(-50%); width: 4px; height: 4px;
  background: var(--primary); border-radius: 50%;
}

.nav-actions { display: flex; align-items: center; gap: 20px; }

.burger-btn {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; background: none; border: none; cursor: pointer; padding: 0;
  width: 40px; height: 40px; margin-left: auto;
}
.burger-btn span {
  width: 22px; height: 1.5px; background: var(--text-main);
  transition: 0.3s; border-radius: 2px;
}

.mobile-menu {
  position: fixed; top: var(--header-height); left: 0; right: 0;
  background: var(--bg-page); border-bottom: 1px solid var(--border);
  padding: 30px; transform: translateY(-150%);
  transition: transform 0.4s ease; z-index: 99;
}
.mobile-menu.active { transform: translateY(0); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 20px; text-align: center; }
.mobile-menu nav a {
  font-size: 16px; font-weight: 500; padding: 10px 0; 
  border-bottom: 1px solid rgba(0,0,0,0.05); font-family: var(--font-serif);
}

/* =========================================
   5. 通用動畫 & 圖片
   ========================================= */
.fade-up {
  opacity: 0; transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fade-up.animate { opacity: 1; transform: translateY(0); }

.blur-load {
  background-size: cover; background-position: center; background-color: #F0F0F0;
}
.blur-load img { opacity: 0; transition: opacity 0.8s ease; }
.blur-load.loaded img { opacity: 1; }

/* =========================================
   6. 隱私權彈窗 (Modal) - 移到 RWD 之前防止被蓋掉
   ========================================= */
.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(51, 51, 51, 0.4); backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.3s ease; padding: 20px;
}
.modal-backdrop.show { opacity: 1; visibility: visible; }

.modal-content {
  background: var(--bg-white); width: 100%; max-width: 800px;
  max-height: 85vh; border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15); display: flex; flex-direction: column;
  transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid var(--border);
}
.modal-backdrop.show .modal-content { transform: translateY(0); }

.modal-header {
  padding: 24px 32px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: #FAFAFA; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-title { margin: 0; font-size: 20px; color: var(--text-main); font-family: var(--font-serif); }
.modal-close {
  background: none; border: none; font-size: 28px; color: var(--text-muted);
  cursor: pointer; padding: 0; line-height: 1; transition: 0.2s;
}
.modal-close:hover { color: var(--primary); }

.modal-body {
  padding: 32px; overflow-y: auto; font-size: 14px; color: var(--text-body);
  line-height: 1.8; scrollbar-width: thin; scrollbar-color: #E0E0E0 transparent;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background-color: #E0E0E0; border-radius: 3px; }

.policy-heading {
  font-size: 18px; color: var(--primary); border-left: 3px solid var(--primary);
  padding-left: 12px; margin: 30px 0 16px;
}
.policy-heading:first-child { margin-top: 0; }
.modal-body h5 { font-size: 15px; color: var(--text-main); font-weight: 700; margin: 24px 0 12px; }
.modal-body ul { padding-left: 20px; list-style: disc; margin-bottom: 16px; }
.modal-body li { margin-bottom: 6px; }
.modal-body p { margin-bottom: 16px; text-align: justify; }
.policy-divider { border: none; border-top: 1px dashed var(--border); margin: 40px 0; }
.modal-footer {
  padding: 20px 32px; border-top: 1px solid var(--border);
  background: var(--bg-white); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
/* 手機版彈窗調整 */
@media (max-width: 768px) {
  .modal-content { max-height: 90vh; }
  .modal-header, .modal-body { padding: 20px; }
  .modal-footer { padding: 16px 20px; }
  .modal-title { font-size: 18px; }
}

/* =========================================
   7. 頁面內容樣式
   ========================================= */
/* 首頁 */
.hero-section { padding: 100px 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero-content h1 { font-size: 48px; margin-bottom: 32px; color: var(--primary); line-height: 1.3; }
.hero-content h2 {
  font-size: 16px; font-weight: 400; font-family: var(--font-sans); color: var(--text-body);
  margin-bottom: 40px; max-width: 90%; line-height: 2; border-left: 1px solid var(--primary); padding-left: 20px;
}
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-note { font-size: 12px; color: var(--text-muted); opacity: 0.8; }
.image-wrapper {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); height: auto;
}
.image-wrapper img { width: 100%; height: auto; display: block; }

.section-header { margin-bottom: 60px; text-align: center; }
.section-title { font-size: 32px; margin-bottom: 16px; position: relative; display: inline-block; }
.section-title::after {
  content: ''; display: block; width: 40px; height: 2px; background: var(--primary); margin: 16px auto 0; opacity: 0.5;
}
.recruit-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 60px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 60px; margin: 80px 0;
}
.recruit-list li { margin-bottom: 12px; display: flex; align-items: baseline; color: var(--text-main); }
.recruit-list li::before { content: '・'; color: var(--primary); margin-right: 8px; font-weight: bold; }
.recruit-action {
  background: rgba(88, 178, 220, 0.05); border-radius: var(--radius-md); 
  padding: 40px; display: flex; align-items: center; justify-content: center;
}
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; margin-bottom: 100px; }
.feature-card {
  background: var(--bg-white); padding: 40px; border-radius: var(--radius-md);
  border: 1px solid transparent; box-shadow: var(--shadow-sm); transition: 0.4s; position: relative; overflow: hidden;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.icon-box {
  font-family: var(--font-serif); font-size: 48px; color: rgba(88, 178, 220, 0.2);
  position: absolute; top: 10px; right: 20px; width: auto; height: auto; font-weight: 700;
}
.feature-card h3 { font-size: 20px; margin-bottom: 16px; position: relative; z-index: 1;}
.feature-card p { font-size: 15px; color: var(--text-body); margin: 0; position: relative; z-index: 1;}

.stagger-container .feature-card { opacity: 0; transform: translateY(20px); transition: 0.6s ease-out; }
.stagger-container.animate .feature-card:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-container.animate .feature-card:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-container.animate .feature-card:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-container.animate .feature-card:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }

/* 產品頁 */
.product-hero { text-align: center; padding: 100px 0 80px; max-width: 800px; margin: 0 auto; }
.product-hero h1 { font-size: 40px; margin-bottom: 30px; color: var(--text-main); }
.feature-block { padding: 80px 0; display: flex; align-items: center; gap: 80px; }
.feature-block.reverse { flex-direction: row-reverse; background-color: var(--bg-white); position: relative; }
.feature-block.reverse::before { content: ''; position: absolute; inset: 0 -100vw; background: var(--bg-white); z-index: -1; }
.feature-content { flex: 1; }
.feature-content h2 { 
  font-size: 26px; margin-bottom: 30px; color: var(--primary); display: flex; align-items: center; gap: 12px;
}
.feature-content h2::before { content: ''; width: 4px; height: 26px; background: var(--primary); }
.feature-list li { margin-bottom: 16px; padding-left: 20px; position: relative; font-size: 16px; }
.feature-list li::before { content: "—"; position: absolute; left: 0; color: var(--primary-light); }
.feature-visual {
  flex: 1; background: transparent; padding: 0; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); display: flex; overflow: hidden; max-width: 600px; margin: 0 auto;
}
.feature-visual img { width: 100%; height: auto; display: block; object-fit: contain; }
.future-section {
  background: linear-gradient(180deg, rgba(88, 178, 220, 0.05) 0%, rgba(255,255,255,0) 100%);
  border-radius: var(--radius-lg); padding: 80px 40px; text-align: center;
  border: 1px solid rgba(88, 178, 220, 0.1); margin: 100px 0;
}
.future-tag {
  background: white; padding: 12px 24px; border-radius: 2px; box-shadow: var(--shadow-sm);
  color: var(--text-main); font-family: var(--font-serif); border: 1px solid var(--border); font-size: 15px;
}

/* 成功案例 */
.page-header { text-align: center; padding: 80px 0 60px; }
.page-header h1 { font-size: 40px; margin-bottom: 20px; color: var(--text-main); background: none; }
.cases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; margin-bottom: 100px; }
.case-card {
  background: var(--bg-white); border-radius: var(--radius-md); padding: 48px 36px;
  box-shadow: var(--shadow-sm); border: none; transition: 0.4s; position: relative; display: flex; flex-direction: column; height: 100%;
}
.case-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.quote-icon {
  position: absolute; top: 30px; left: 30px; font-size: 80px; font-family: var(--font-serif); color: var(--primary); opacity: 0.1;
}
.case-text {
  font-size: 16px; line-height: 2; margin-top: 20px; margin-bottom: 40px;
  position: relative; z-index: 1; flex: 1; font-style: normal; color: var(--text-main);
}
.case-author { border-top: 1px solid var(--border); padding-top: 24px; display: flex; align-items: center; gap: 16px; }
.author-avatar {
  width: 50px; height: 50px; background: var(--primary); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 20px; flex-shrink: 0;
}
.author-info h4 { margin: 0; font-size: 16px; font-family: var(--font-serif); }

/* 關於星墨 */
.about-section {
  padding: 100px 0; min-height: 80vh; display: flex; flex-direction: column; align-items: center;
  background-image: radial-gradient(#E0E0E0 1px, transparent 1px); background-size: 40px 40px;
}
.about-container { max-width: 800px; margin: 0 auto; text-align: center; }
.about-title {
  font-size: 40px; margin-bottom: 60px; color: var(--text-main); padding-bottom: 20px; border-bottom: 1px solid var(--primary);
}
.about-title::after { display: none; }
.about-content {
  text-align: left; background: var(--bg-white); padding: 80px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); border: none; position: relative; overflow: hidden;
}
.about-content::before { background: radial-gradient(circle, rgba(88, 178, 220, 0.1) 0%, transparent 70%); }
.about-text { font-size: 18px; line-height: 2.2; margin-bottom: 40px; }
.highlight-para {
  font-size: 22px; font-family: var(--font-serif); color: var(--primary-dark);
  border-left: 4px solid var(--primary); padding: 30px 40px; margin: 50px -40px;
  background: rgba(88, 178, 220, 0.05); border-radius: 0;
}
.legal-note {
  margin-top: 50px; font-size: 13px; color: var(--text-muted); 
  background: white; border: 1px solid var(--border); padding: 12px 30px; border-radius: 50px;
}

/* 表單 */
.form-header { text-align: center; margin: 80px 0 50px; }
.form-card {
  background: var(--bg-white); border-radius: var(--radius-md); 
  box-shadow: var(--shadow-md); padding: 60px; max-width: 800px; margin: 0 auto 100px; border: 1px solid rgba(0,0,0,0.02);
}
.form-note {
  background: transparent; color: var(--primary); padding: 12px 20px;
  border-bottom: 1px solid var(--primary); border-radius: 0; font-size: 15px; margin-bottom: 40px; text-align: center;
}
label { 
  font-size: 14px; font-weight: 500; color: var(--text-main); margin-bottom: 8px; display: block; letter-spacing: 0.05em;
}
label.required::after { content: "*"; color: var(--primary); margin-left: 4px; }
input, select, textarea {
  width: 100%; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; background: #FAFAFA;
  transition: all 0.3s; font-family: inherit; color: var(--text-main);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); background: white;
  box-shadow: 0 0 0 2px rgba(88, 178, 220, 0.2);
}

.success-message { padding: 60px 20px; }

/* 修正打勾勾位置 */
.success-icon {
  width: 80px; height: 80px; background: transparent; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 50%; font-size: 40px; margin: 0 auto 30px;
  display: flex; align-items: center; justify-content: center; line-height: 1; /* 確保符號垂直居中 */
}

/* Footer */
.footer {
  background: white; border-top: 1px solid var(--border); padding: 60px 0;
  text-align: center; font-size: 13px; color: var(--text-muted);
}
.footer-links a:hover { color: var(--primary); text-decoration: none; border-bottom: 1px solid var(--primary); }

/* =========================================
   8. 響應式調整 (手機版)
   ========================================= */
@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 50px; }
  .recruit-card { grid-template-columns: 1fr; padding: 40px; }
  .hero-btns { justify-content: center; }
  .hero-content h2 { margin: 0 auto 40px; border-left: none; padding-left: 0; }
  .feature-block, .feature-block.reverse { flex-direction: column; gap: 40px; padding: 60px 0; }
  .feature-block.reverse::before { display: none; }
  .highlight-para { margin: 30px -20px; padding: 20px; }
}

@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .burger-btn { display: flex; }
  
  .nav-actions .btn { display: none; } /* 隱藏Header按鈕 */
  .container { padding: 0 20px; }

  .hero-content h1 { font-size: 34px; }
  .features-grid { grid-template-columns: 1fr; }
  .cases-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .about-content { padding: 40px 24px; }

  /* 表單手機版優化 */
  .form-header { margin: 40px 0 30px; }
  .form-card { padding: 30px 20px; margin-bottom: 60px; }
  input, select, textarea { padding: 12px; font-size: 16px; }
  .form-note { margin-bottom: 24px; font-size: 14px; }
}
/* =========================================
   13. 政策頁面專用 (Policy Page)
   ========================================= */
.policy-anchor {
  /* 防止錨點定位時被 Header 擋住 */
  scroll-margin-top: 100px; 
}

.policy-sub-title {
  font-size: 18px;
  color: var(--primary-dark);
  margin: 30px 0 16px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
  font-family: var(--font-serif);
}

.policy-text p {
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text-main);
  text-align: justify; /* 左右對齊讓文字區塊更整齊 */
}

.policy-text ul {
  padding-left: 20px;
  list-style: disc;
  margin-bottom: 20px;
}

.policy-text li {
  margin-bottom: 8px;
  color: var(--text-body);
}