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

body {
  background-color: #f8f5e9;
  background-image: url("https://img.freepik.com/free-photo/old-paper-texture-background_1150-117.jpg");
  background-size: cover;
  background-position: center;
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #2b2b2b;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url("https://img.freepik.com/free-photo/black-ink-blot-texture_1150-118.jpg") repeat;
  opacity: 0.05;
  animation: inkFlow 30s infinite alternate;
  z-index: -1;
}

@keyframes inkFlow {
  0% { transform: translate(0,0) scale(1); opacity:0.03; }
  50% { transform: translate(-50px,30px) scale(1.05); opacity:0.05; }
  100% { transform: translate(0,0) scale(1); opacity:0.03; }
}

header {
  width: 100%;
  max-width: 700px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#search-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 1em;
  border: 1px solid #d3c6a0;
  border-radius: 8px;
  margin-right: 10px;
}

#category-btn {
  padding: 8px 12px;
  font-size: 1em;
  border-radius: 8px;
  border: 1px solid #d3c6a0;
  background-color: #fff;
  cursor: pointer;
}

#category-list {
  position: absolute;
  top: 50px;
  right: 20px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #d3c6a0;
  border-radius: 8px;
  list-style: none;
  padding: 10px;
  display: none;
  z-index: 10;
}

#category-list li {
  padding: 6px 12px;
  cursor: pointer;
}

#category-list li:hover {
  background-color: #f1e9d2;
}

.container {
  text-align: center;
  max-width: 700px;
  padding: 40px;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid #d3c6a0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border-radius: 16px;
}

h1 {
  font-size: 2em;
  margin-bottom: 0.5em;
  font-weight: bold;
}

h3 {
  font-size: 1.2em;
  color: #555;
  margin-bottom: 1em;
}

p {
  line-height: 1.8em;
  font-size: 1.1em;
  white-space: pre-line;
}

.extra {
  margin-top: 1.5em;
  padding-top: 1em;
  border-top: 1px dashed #d1c4a3;
  font-size: 0.95em;
  color: #4b3d2f;
  display: none;
  opacity: 0;
  transition: opacity 0.8s;
}

.extra.show {
  display: block;
  opacity: 1;
}

.fade {
  opacity: 0;
  transition: opacity 1.5s;
}

@keyframes inkSpread {
  0% { filter: blur(10px); opacity: 0; transform: scale(0.95); }
  50% { filter: blur(5px); opacity: 0.6; transform: scale(1.02); }
  100% { filter: blur(0); opacity: 1; transform: scale(1); }
}

.fade-ink {
  animation: inkSpread 1.5s ease forwards;
}