/* ========================================
   全職設計視角 — Gallery Styles
   ======================================== */

:root {
  --gallery-bg: #0a0a0f;
  --gallery-surface: #141420;
  --gallery-surface2: #1c1c2e;
  --gallery-border: #2a2a3e;
  --gallery-text: #e8e8f0;
  --gallery-text2: #a0a0b8;
  --gallery-primary: #6c5ce7;
  --gallery-primary-hover: #7f70f0;
  --gallery-accent: #00d2d3;
  --gallery-success: #00b894;
  --gallery-warning: #fdcb6e;
  --gallery-radius: 16px;
  --gallery-radius-sm: 8px;
  --gallery-shadow: 0 8px 32px rgba(0,0,0,0.3);
  --font-sans: 'Noto Sans TC', 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--gallery-bg); color: var(--gallery-text); line-height: 1.6; }

/* Header */
.gallery-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.92); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gallery-border);
}
.gallery-nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.gallery-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--gallery-text); font-weight: 700; font-size: 1.1rem;
}
.brand-icon { font-size: 1.4rem; color: var(--gallery-primary); }
.gallery-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.gallery-menu a {
  display: block; padding: 8px 16px; border-radius: var(--gallery-radius-sm);
  color: var(--gallery-text2); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  transition: all 0.2s;
}
.gallery-menu a:hover, .gallery-menu a.active { color: #fff; background: var(--gallery-surface2); }

/* Hamburger */
.gallery-hamburger {
  display: flex; flex-direction: column; gap: 5px; padding: 8px;
  background: none; border: none; cursor: pointer;
}
.gallery-hamburger span {
  display: block; width: 24px; height: 2px; background: var(--gallery-text);
  transition: all 0.3s; border-radius: 2px;
}
.gallery-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.gallery-hamburger.active span:nth-child(2) { opacity: 0; }
.gallery-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile Drawer */
.mobile-drawer {
  position: fixed; top: 64px; right: -300px; width: 280px; height: calc(100vh - 64px);
  background: var(--gallery-surface); border-left: 1px solid var(--gallery-border);
  transition: right 0.3s; z-index: 99; overflow-y: auto;
}
.mobile-drawer.open { right: 0; }
.mobile-drawer ul { list-style: none; padding: 20px; margin: 0; }
.mobile-drawer li { margin-bottom: 4px; }
.mobile-drawer a {
  display: block; padding: 12px 16px; color: var(--gallery-text); text-decoration: none;
  border-radius: var(--gallery-radius-sm); font-weight: 500; transition: background 0.2s;
}
.mobile-drawer a:hover { background: var(--gallery-surface2); }

/* Hero */
.gallery-hero {
  padding: 80px 0 60px;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1030 50%, #0a0a1a 100%);
}
.hero-badge {
  display: inline-block; padding: 8px 20px; border-radius: 50px;
  background: rgba(108,92,231,0.15); color: var(--gallery-primary);
  font-size: 0.85rem; font-weight: 600; margin-bottom: 20px;
  border: 1px solid rgba(108,92,231,0.3);
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 900; margin: 0 0 16px;
  background: linear-gradient(135deg, #fff 30%, var(--gallery-primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { font-size: 1.1rem; color: var(--gallery-text2); max-width: 640px; margin: 0 auto 40px; }
.hero-stats {
  display: flex; justify-content: center; gap: 48px; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-number { display: block; font-size: 2.2rem; font-weight: 800; color: var(--gallery-primary); }
.stat-label { font-size: 0.85rem; color: var(--gallery-text2); }

/* Hot Tags */
.hot-tags-section { padding: 24px 0; border-bottom: 1px solid var(--gallery-border); }
.hot-tags-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hot-tags-label { font-size: 0.9rem; font-weight: 600; color: var(--gallery-text2); white-space: nowrap; }
.hot-tags-list { display: flex; gap: 8px; flex-wrap: wrap; }
.hot-tag {
  padding: 6px 16px; border-radius: 50px; border: 1px solid var(--gallery-border);
  background: transparent; color: var(--gallery-text2); font-size: 0.82rem; cursor: pointer;
  transition: all 0.2s; font-family: var(--font-sans);
}
.hot-tag:hover { border-color: var(--gallery-primary); color: var(--gallery-primary); }
.hot-tag.active { background: var(--gallery-primary); border-color: var(--gallery-primary); color: #fff; }

/* Templates Layout */
.templates-section { padding: 40px 0 80px; }
.templates-layout { display: flex; gap: 32px; }

/* Filter Sidebar */
.filter-sidebar {
  width: 280px; flex-shrink: 0; position: sticky; top: 104px;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.filter-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.filter-header h3 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.filter-header h3 i { margin-right: 8px; color: var(--gallery-primary); }
.filter-reset {
  background: none; border: none; color: var(--gallery-primary); font-size: 0.82rem;
  cursor: pointer; font-family: var(--font-sans);
}
.filter-search {
  position: relative; margin-bottom: 24px;
}
.filter-search input {
  width: 100%; padding: 10px 16px 10px 40px; border-radius: var(--gallery-radius-sm);
  border: 1px solid var(--gallery-border); background: var(--gallery-surface);
  color: var(--gallery-text); font-size: 0.9rem; font-family: var(--font-sans);
  outline: none; transition: border-color 0.2s;
}
.filter-search input:focus { border-color: var(--gallery-primary); }
.filter-search i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gallery-text2); font-size: 0.9rem;
}
.filter-group { margin-bottom: 24px; }
.filter-group-title {
  font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--gallery-text);
}
.filter-group-title i { font-size: 0.75rem; color: var(--gallery-text2); transition: transform 0.2s; }
.filter-group-title.collapsed i { transform: rotate(-90deg); }
.filter-options { display: flex; flex-direction: column; gap: 6px; }
.filter-option {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 6px; cursor: pointer; font-size: 0.85rem; color: var(--gallery-text2);
  transition: background 0.2s;
}
.filter-option:hover { background: var(--gallery-surface2); }
.filter-option input[type="checkbox"] {
  accent-color: var(--gallery-primary); width: 16px; height: 16px;
}

/* Templates Content */
.templates-content { flex: 1; min-width: 0; }
.templates-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--gallery-border);
}
.result-count { font-size: 0.9rem; color: var(--gallery-text2); }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
  padding: 8px 12px; border-radius: 6px; border: 1px solid var(--gallery-border);
  background: transparent; color: var(--gallery-text2); cursor: pointer;
  transition: all 0.2s;
}
.view-btn:hover { border-color: var(--gallery-primary); color: var(--gallery-primary); }
.view-btn.active { background: var(--gallery-primary); border-color: var(--gallery-primary); color: #fff; }

/* Templates Grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.templates-grid.list-view {
  grid-template-columns: 1fr;
}
.templates-grid.list-view .template-card {
  display: grid; grid-template-columns: 280px 1fr; gap: 0;
}
.templates-grid.list-view .template-card-image { height: 180px; }

/* Template Card */
.template-card {
  background: var(--gallery-surface); border-radius: var(--gallery-radius);
  border: 1px solid var(--gallery-border); overflow: hidden;
  transition: all 0.3s; cursor: default;
}
.template-card:hover {
  border-color: var(--gallery-primary); transform: translateY(-4px);
  box-shadow: var(--gallery-shadow);
}
.template-card-image {
  position: relative; height: 220px; overflow: hidden;
  background: var(--gallery-surface2);
}
.template-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.template-card:hover .template-card-image img { transform: scale(1.05); }
.card-badges {
  position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap;
}
.card-badge {
  padding: 4px 10px; border-radius: 50px; font-size: 0.7rem; font-weight: 600;
  backdrop-filter: blur(10px);
}
.badge-dark { background: rgba(0,0,0,0.6); color: #fff; }
.badge-light { background: rgba(255,255,255,0.85); color: #333; }
.badge-industry { background: rgba(108,92,231,0.8); color: #fff; }
.badge-pages { background: rgba(0,210,211,0.8); color: #fff; }
.template-card-body { padding: 20px; }
.card-number { font-size: 0.75rem; color: var(--gallery-primary); font-weight: 600; margin-bottom: 4px; }
.card-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: #fff; }
.card-layout { font-size: 0.82rem; color: var(--gallery-text2); margin-bottom: 12px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.card-tag {
  padding: 3px 10px; border-radius: 50px; font-size: 0.72rem;
  background: var(--gallery-surface2); color: var(--gallery-text2);
  border: 1px solid var(--gallery-border);
}
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-btn {
  padding: 8px 14px; border-radius: var(--gallery-radius-sm); font-size: 0.8rem;
  font-weight: 600; text-decoration: none; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
  font-family: var(--font-sans);
}
.card-btn-primary { background: var(--gallery-primary); color: #fff; }
.card-btn-primary:hover { background: var(--gallery-primary-hover); }
.card-btn-outline {
  background: transparent; color: var(--gallery-text2);
  border: 1px solid var(--gallery-border);
}
.card-btn-outline:hover { border-color: var(--gallery-primary); color: var(--gallery-primary); }
.card-btn-disabled {
  background: transparent; color: var(--gallery-text2); opacity: 0.5;
  border: 1px solid var(--gallery-border); cursor: not-allowed;
}

/* Empty State */
.empty-state {
  text-align: center; padding: 80px 20px;
}
.empty-state i { font-size: 3rem; color: var(--gallery-text2); margin-bottom: 16px; display: block; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--gallery-text2); margin-bottom: 24px; }

/* About Section */
.about-section { padding: 80px 0; border-top: 1px solid var(--gallery-border); }
.section-title {
  font-size: 1.6rem; font-weight: 800; margin-bottom: 32px;
  color: #fff;
}
.about-card { display: flex; flex-direction: column; gap: 24px; }
.about-step {
  display: flex; gap: 16px; align-items: flex-start;
}
.step-num {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gallery-primary); color: #fff; font-weight: 700;
  flex-shrink: 0;
}
.about-step h4 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.about-step p { font-size: 0.9rem; color: var(--gallery-text2); margin: 0; }
.about-text { font-size: 1rem; color: var(--gallery-text2); margin-bottom: 16px; }
.about-features { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.feature-item { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }

/* Footer */
.gallery-footer {
  padding: 60px 0 30px; border-top: 1px solid var(--gallery-border);
  background: var(--gallery-surface);
}
.footer-brand {
  display: flex; align-items: center; gap: 10px; font-size: 1.1rem;
  font-weight: 700; margin-bottom: 16px; color: #fff;
}
.footer-desc { font-size: 0.9rem; color: var(--gallery-text2); }
.gallery-footer h5 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; font-size: 0.9rem; color: var(--gallery-text2); }
.footer-links a { color: var(--gallery-text2); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--gallery-primary); }
.footer-divider { border-color: var(--gallery-border); margin: 32px 0 20px; }
.footer-bottom { text-align: center; }
.footer-bottom p { font-size: 0.82rem; color: var(--gallery-text2); margin: 0; }

/* Back to Top */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px; width: 48px; height: 48px;
  border-radius: 50%; background: var(--gallery-primary); color: #fff;
  border: none; cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 90;
  box-shadow: 0 4px 16px rgba(108,92,231,0.4);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--gallery-primary-hover); transform: translateY(-2px); }

/* ========================================
   Detail Page
   ======================================== */
.detail-page { background: var(--gallery-bg); }
.detail-main { padding-top: 64px; min-height: 80vh; }
.detail-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 16px;
}
.detail-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 16px; text-align: center;
}
.detail-error i { font-size: 3rem; color: var(--gallery-warning); }

.detail-hero {
  position: relative; min-height: 400px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center; padding: 60px 0 40px;
}
.detail-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,10,15,0.95) 0%, rgba(10,10,15,0.5) 50%, rgba(10,10,15,0.3) 100%);
}
.detail-back {
  display: inline-flex; align-items: center; gap: 8px; color: var(--gallery-text2);
  text-decoration: none; margin-bottom: 20px; font-size: 0.9rem; transition: color 0.2s;
}
.detail-back:hover { color: var(--gallery-primary); }
.detail-title { font-size: 2.5rem; font-weight: 900; margin-bottom: 12px; }
.detail-desc { font-size: 1.1rem; color: var(--gallery-text2); margin-bottom: 24px; max-width: 600px; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.detail-info { padding: 40px 0 80px; }
.detail-card {
  background: var(--gallery-surface); border-radius: var(--gallery-radius);
  border: 1px solid var(--gallery-border); padding: 28px;
}
.detail-card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 20px; }
.detail-card h2 i { color: var(--gallery-primary); margin-right: 8px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-label { font-size: 0.78rem; color: var(--gallery-text2); font-weight: 500; }
.info-value { font-size: 0.95rem; font-weight: 600; }

.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-tag {
  padding: 6px 14px; border-radius: 50px; font-size: 0.8rem;
  background: var(--gallery-surface2); color: var(--gallery-text2);
  border: 1px solid var(--gallery-border);
}

.pages-list { display: flex; flex-direction: column; gap: 8px; }
.page-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--gallery-surface2); border-radius: var(--gallery-radius-sm);
}
.page-num { font-size: 0.78rem; font-weight: 700; color: var(--gallery-primary); min-width: 28px; }
.page-name { font-size: 0.9rem; }

.spec-list { list-style: none; padding: 0; margin: 0; }
.spec-list li {
  padding: 8px 0; border-bottom: 1px solid var(--gallery-border);
  font-size: 0.88rem; color: var(--gallery-text2);
}
.spec-list li:last-child { border-bottom: none; }
.spec-list strong { color: var(--gallery-text); }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 991px) {
  .filter-sidebar { display: none; }
  .templates-layout { flex-direction: column; }
  .templates-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-width: 767px) {
  .gallery-hero { padding: 48px 0 40px; }
  .hero-stats { gap: 24px; }
  .templates-grid { grid-template-columns: 1fr; }
  .templates-grid.list-view .template-card { grid-template-columns: 1fr; }
  .detail-title { font-size: 1.8rem; }
  .detail-actions { flex-direction: column; }
  .detail-actions .btn { width: 100%; text-align: center; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .hot-tags-wrap { flex-direction: column; align-items: flex-start; }
  .card-actions { flex-direction: column; }
  .card-btn { justify-content: center; }
}
