/* ========================================
   SUBPAGES DESIGN SYSTEM
   Mobile-First Responsive
======================================== */

/* === CSS Variables === */
:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-elevated: #1a1a1d;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-card: rgba(255, 255, 255, 0.02);
  
  --text-primary: #fafafa;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);
  
  --accent-primary: #e85d04;
  --accent-secondary: #f48c06;
  --accent-glow: rgba(232, 93, 4, 0.4);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media screen and (min-width: 769px) {
  :root {
    --radius-md: 16px;
    --radius-lg: 24px;
  }
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media screen and (min-width: 769px) {
  body {
    font-size: 16px;
  }
}

/* Ambient background effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(232, 93, 4, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(244, 140, 6, 0.03), transparent);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   PAGE HEADER
======================================== */
.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.page-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

@media screen and (min-width: 769px) {
  .page-header-inner {
    padding: 1rem 2rem;
  }
}

.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all var(--transition-smooth);
}

@media screen and (min-width: 769px) {
  .page-header h1 {
    font-size: 1.5rem;
  }
}

.page-header a {
  display: block;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

@media screen and (min-width: 769px) {
  .back-link {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }
}

.back-link:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

/* ========================================
   CONTENT CONTAINER
======================================== */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 1rem 1.5rem;
}

@media screen and (min-width: 769px) {
  .page-content {
    padding: 90px 2rem 2rem;
  }
}

@media screen and (min-width: 1024px) {
  .page-content {
    padding: 100px 2rem 2rem;
  }
}

/* Special padding for About page to fit content in viewport */
.page-content--about {
  padding-top: 60px;
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
}

@media screen and (min-width: 769px) {
  .page-content--about {
    padding-top: 70px;
    padding-bottom: 1rem;
    min-height: calc(100vh - 70px);
  }
}

@media screen and (min-width: 1024px) {
  .page-content--about {
    padding-top: 80px;
    min-height: calc(100vh - 80px);
  }
}

/* ========================================
   ABOUT PAGE STYLES
======================================== */
.about-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  justify-content: center;
}

@media screen and (min-width: 769px) {
  .about-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2.5rem;
    align-items: center; /* 圖片和文字垂直居中 */
  }
}

@media screen and (min-width: 1024px) {
  .about-container {
    grid-template-columns: 1.7fr 1fr;
    gap: 3.5rem;
  }
}

.about-content {
  order: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media screen and (min-width: 769px) {
  .about-content {
    order: 1;
    padding-right: 1rem;
  }
}

.about-content p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: justify;
  margin: 0;
}

@media screen and (min-width: 769px) {
  .about-content p {
    font-size: 0.95rem;
    line-height: 1.85;
  }
}

@media screen and (min-width: 1024px) {
  .about-content p {
    font-size: 1rem;
    line-height: 1.9;
  }
}

.about-image {
  order: 1;
  max-width: 250px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media screen and (min-width: 769px) {
  .about-image {
    order: 2;
    max-width: 100%;
    margin: 0;
  }
}

.about-image img {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

@media screen and (min-width: 1024px) {
  .about-image img {
    max-width: 380px;
  }
}

.about-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 600;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

@media screen and (min-width: 769px) {
  .about-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }
}

@media screen and (min-width: 1024px) {
  .about-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
}

/* ========================================
   NEWS PAGE STYLES
======================================== */
.news-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: calc(100vh - 100px);
}

@media screen and (min-width: 900px) {
  .news-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
  }
}

.news-sidebar {
  display: none;
}

@media screen and (min-width: 900px) {
  .news-sidebar {
    display: block;
    position: sticky;
    top: 100px;
    height: fit-content;
    padding: 1.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
  }
}

.news-sidebar h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.news-sidebar ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-sidebar li a {
  display: block;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.news-sidebar li a:hover {
  color: var(--accent-secondary);
  background: rgba(232, 93, 4, 0.1);
  transform: translateX(4px);
}

.news-sidebar li a.active {
  color: var(--accent-primary);
  background: rgba(232, 93, 4, 0.15);
  border-left: 2px solid var(--accent-primary);
  padding-left: calc(0.6rem - 2px);
}

.news-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 2rem;
}

@media screen and (min-width: 769px) {
  .news-main {
    gap: 2rem;
    padding-bottom: 4rem;
  }
}

.news-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.news-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media screen and (min-width: 769px) {
  .news-card:hover {
    transform: translateY(-4px);
  }
}

.news-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid var(--border-subtle);
}

.news-card-content {
  padding: 1rem;
}

@media screen and (min-width: 769px) {
  .news-card-content {
    padding: 1.5rem;
  }
}

.news-card p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

@media screen and (min-width: 769px) {
  .news-card p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
  }
}

.news-card .timestamp {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-secondary);
  letter-spacing: 0.1em;
}

@media screen and (min-width: 769px) {
  .news-card .timestamp {
    font-size: 0.8rem;
  }
}

/* ========================================
   BLOG PAGE STYLES
======================================== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media screen and (min-width: 769px) {
  .blog-list {
    gap: 1.5rem;
  }
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-smooth);
}

@media screen and (min-width: 600px) {
  .blog-card {
    flex-direction: row;
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

.blog-card:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

@media screen and (min-width: 769px) {
  .blog-card:hover {
    transform: translateX(8px);
  }
}

.blog-card-image {
  flex-shrink: 0;
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

@media screen and (min-width: 600px) {
  .blog-card-image {
    width: 180px;
    height: 130px;
  }
}

@media screen and (min-width: 769px) {
  .blog-card-image {
    width: 200px;
    height: 150px;
  }
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

@media screen and (min-width: 769px) {
  .blog-card-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
  }
}

.blog-card:hover .blog-card-title {
  color: var(--accent-secondary);
}

.blog-card-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

@media screen and (min-width: 769px) {
  .blog-card-preview {
    font-size: 0.95rem;
  }
}

/* ========================================
   PROJECT PAGE STYLES (AI, Game, Art)
======================================== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media screen and (min-width: 769px) {
  .project-list {
    gap: 4rem;
  }
}

.project-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-smooth);
}

@media screen and (min-width: 769px) {
  .project-card {
    border-radius: var(--radius-lg);
  }
}

.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.project-card-content {
  padding: 1.25rem;
}

@media screen and (min-width: 769px) {
  .project-card-content {
    padding: 2rem;
  }
}

.project-card-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

@media screen and (min-width: 769px) {
  .project-card-title {
    margin-bottom: 1rem;
  }
}

.project-card-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
}

@media screen and (min-width: 769px) {
  .project-card-title::after {
    width: 50px;
  }
}

.project-card-description {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

@media screen and (min-width: 769px) {
  .project-card-description {
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
  }
}

.project-card-description a {
  color: var(--accent-secondary);
  border-bottom: 1px solid var(--accent-secondary);
  transition: all var(--transition-fast);
}

.project-card-description a:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.project-card img {
  width: 100%;
  border-top: 1px solid var(--border-subtle);
  transition: transform var(--transition-smooth);
}

.project-card:hover img {
  transform: scale(1.01);
}

@media screen and (min-width: 769px) {
  .project-card:hover img {
    transform: scale(1.02);
  }
}

/* ========================================
   CONTACT PAGE STYLES
======================================== */
.contact-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 1rem;
}

@media screen and (min-width: 769px) {
  .contact-container {
    min-height: calc(100vh - 200px);
    padding: 2rem;
  }
}

.contact-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
}

@media screen and (min-width: 769px) {
  .contact-card {
    padding: 4rem;
  }
}

.contact-card h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media screen and (min-width: 769px) {
  .contact-card h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
}

.contact-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

@media screen and (min-width: 769px) {
  .contact-card p {
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
  }
}

.contact-email {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  word-break: break-all;
}

@media screen and (min-width: 769px) {
  .contact-email {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
}

.contact-email:hover {
  background: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ========================================
   PAGE TITLE
======================================== */
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

@media screen and (min-width: 769px) {
  .page-title {
    margin-bottom: 2rem;
  }
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
  border-radius: 2px;
}

@media screen and (min-width: 769px) {
  .page-title::after {
    bottom: -8px;
    width: 60px;
  }
}

/* ========================================
   SCROLLBAR
======================================== */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

@media screen and (min-width: 769px) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* === Selection === */
::selection {
  background: var(--accent-primary);
  color: var(--text-primary);
}
