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

body {
  font-family: "Noto Sans CJK SC", "Microsoft YaHei UI", "Noto Sans", "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: white;
  color: #fff;
}

.background {
  position: fixed;
  inset: 0;
  background-image: url("bg.svg");
  background-position: center;
  background-size: cover;
  z-index: -2;
}

.shade {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

a {
  color: inherit;
}

a:hover {
  text-decoration: underline;
}

/* Navigation */
nav {
  padding: 1rem;
}

nav h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

/* Main content */
main {
  flex-grow: 1;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
}

/* Koto Display */
.koto {
  text-align: center;
  padding: 1rem;
  margin: 2rem 0;
}

.koto__hitokoto {
  font-size: 2rem;
  line-height: 1.6;
  margin: 0.5rem 6rem;
}

.koto__bracket_open,
.koto__bracket_close {
  margin: 0.5rem 0;
  font-size: 2rem;
}

.koto__bracket_open {
  text-align: start;
}

.koto__bracket_close {
  text-align: end;
}

.koto::after {
  content: "";
  display: table;
  clear: both;
}

.koto__author {
  font-size: 1.5rem;
  margin: 2rem 0 0;
  text-align: end;
}

.koto__author::before {
  content: "——";
}

/* API Section */
#api {
  margin: 2rem 0;
}

#api h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* Responsive table */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.apitable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.apitable th,
.apitable td {
  text-align: start;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.apitable tr:last-child td {
  border-bottom: none;
}

.apitable code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15em 0.3em;
  border-radius: 0.25rem;
  font-size: 0.85em;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .koto {
    padding: 0;
  }
  .koto__hitokoto {
    font-size: 1.5rem;
    margin: 0.5rem 2rem;
  }

  .koto__bracket_open,
  .koto__bracket_close {
    font-size: 1.5rem;
  }

  .koto__author {
    font-size: 1.25rem;
  }

  #api {
    padding: 0 0.5rem;
  }

  .apitable {
    font-size: 0.85rem;
  }

  .apitable td {
    padding: 0.4rem 0.5rem;
  }
}
