/* 通用樣式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --accent: #2337ff;
  --accent-dark: #000d8a;
  --black: 15, 18, 25;
  --gray: 96, 115, 159;
  --gray-light: 229, 233, 240;
  --gray-dark: 34, 41, 57;
  --gray-gradient: rgba(var(--gray-light), 50%), #fff;
  --box-shadow: 0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%), 0 16px 32px rgba(var(--gray), 33%);
}

@font-face {
  font-family: Atkinson;
  src: url(/fonts/atkinson-regular.woff) format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Atkinson;
  src: url(/fonts/atkinson-bold.woff) format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: Atkinson, sans-serif;
  margin: 0;
  padding: 0;
  text-align: left;
  background: linear-gradient(var(--gray-gradient)) no-repeat;
  background-size: 100% 600px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  color: rgb(var(--gray-dark));
  line-height: 1.7;
}

body, html {
	height: 100%;
	display: flex;
	flex-direction: column;
}

main {
  width: 960px;
  max-width: calc(100% - 2em);
  margin: auto;
  padding: 3em 1em;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5rem;
  color: rgb(var(--black));
  line-height: 1.2;
}

.right, h4 {
	width: 400px;
}

strong, b {
  font-weight: 700;
}

a, a:hover {
  color: var(--accent);
}

p {
  margin-bottom: 1em;
  margin: 5px 40px;
  padding: 1px 40px;
  width: 100%;
  text-align: left;
}

.prose p {
  margin-bottom: 2em;
}

.prose ul {
  padding-left: 2em;
}

textarea {
  width: 100%;
  font-size: 16px;
}

input {
  font-size: 16px;
}

table {
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

code {
  padding: 2px 5px;
  background-color: rgb(var(--gray-light));
  border-radius: 2px;
}

pre {
  padding: 1.5em;
  border-radius: 8px;
}

pre > code {
  all: unset;
}

blockquote {
  border-left: 4px solid var(--accent);
  padding: 0 0 0 20px;
  margin: 0;
  font-size: 1.333em;
}

hr {
  border: none;
  border-top: 1px solid rgb(var(--gray-light));
}

.links {
	display: flex;
	gap: 10px;
	margin-top: 20px;
}

.links a {
  padding: 10px 20px;
  text-decoration: none;
  color: #333;
  font-size: 1.1rem;
  border: 2px solid #333;
  border-radius: 5px;
  text-align: center;
  transition: all 0.3s ease;
}

.sr-only {
  border: 0;
  padding: 0;
  margin: 0;
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px 1px 1px 1px);
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
}

.date {
  font-size: 14px;
}

/* 導航欄樣式 */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1em;
  background: #fff;
  box-shadow: 0 2px 8px rgba(var(--black), 5%);
}

nav a {
  padding: 1em 0.5em;
  color: rgb(var(--black));
  border-bottom: 4px solid transparent;
  text-decoration: none;
}

nav a.active {
  border-bottom-color: var(--accent);
}

/* 容器布局 */
.container {
  display: flex;
  height: 100%;
}

.left {
  flex: 1;
  background-size: cover;
  background-position: center;
}

.right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* 動畫效果 */
.fade-in-text {
  opacity: 0;
  animation: fadeIn 1.4s ease-in forwards, fadeInLeft 0.7s ease-out forwards;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInLeft {
  0% { transform: translate(-30px); }
  to { transform: translate(0); }
}

/* 响應式設計 */
@media (max-width: 720px) {
  body { font-size: 18px; }
  main { padding: 1em; }
  .links a { padding: 5px 10px; }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    justify-content: flex-start;
  }
  .left, .right {
    width: 100%;
  }
  .left {
    height: 50vh;
  }
}

/* 博客列表樣式 */
ul#postList {
  list-style-type: none;
  margin: 42vh 0;
  padding: 0;
}

ul#postList li {
  display: flex;
  align-items: center;
  gap: 1rem;
  box-sizing: border-box;
  flex: 1 1 100%;
  padding: 1rem;
  border-bottom: 1px solid #ddd;
}

ul#postList .left {
  width: 50%;
  box-sizing: border-box;
  text-align: right;
}

ul#postList .left img {
  display: block;
  margin-left: auto;
  width: 100%;
  height: auto;
  border-radius: 12px;
  aspect-ratio: 960 / 480;
}

ul#postList .right {
  width: 50%;
  box-sizing: border-box;
  padding: 0 20px;
}

ul#postList li img {
  transition: width 0.1s ease;
}

/* 音樂頁面樣式 */
iframe {
  border: none;
  background-color: transparent;
  flex: 1;
  display: block;
  margin: auto;
  width: 0;
  height: 150px;
  transition: width 0.5s ease-out, height 0.5s ease-out;
}

iframe.active {
  width: 150px;
  height: 150px;
}

/* 博客文章頁面樣式 */
.hero-image {
  width: 100%;
}

.hero-image img {
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
}

.prose {
  width: 720px;
  max-width: calc(100% - 2em);
  margin: auto;
  padding: 1em;
  color: rgb(var(--gray-dark));
}

.title {
  text-align: center;
  line-height: 1;
}

.title h1 {
  margin: 0 0 0.5em;
}

/* 頁尾樣式 */
footer {
  padding: 2em 1em 6em;
  background: linear-gradient(var(--gray-gradient)) no-repeat;
  color: rgb(var(--gray));
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-top: 1em;
}

.social-links a {
  text-decoration: none;
  color: rgb(var(--gray));
}

.social-links a:hover {
  color: rgb(var(--gray-dark));
}

.site-title {
	width: 320px;
	text-align: center;
}

.site-description {
	font-size: 1.2rem;
	margin-bottom: 40px;
	text-align: center;
	width: 316px;
}