body {
  font-family: system-ui, sans-serif;
  padding: 20px;
  background: #fafafa;
  color: #111;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

textarea {
  width: 100%;
  height: 120px;
  font-size: 18px;
  margin-bottom: 10px;
  padding: 8px;
  box-sizing: border-box;
}

.controls-wrapper {
  position: relative;
  margin-bottom: 10px;
}

#settings-menu {
  display: none;
  position: absolute;
  top: 30px;
  left: 0;
  background: #f0f0f0;
  color: #111;
  padding: 10px;
  border-radius: 5px;
  z-index: 500;
}

#settings-menu.open { display: block; }

#import-section {
  margin-bottom: 10px;
}

#reader {
  max-width: 800px;
  margin: auto;
  position: relative;
}

#hanzi {
  line-height: 1.6;
  margin-bottom: 14px;
  white-space: pre-wrap;
  font-family: "Noto Sans SC", "Microsoft YaHei", "SimSun", "KaiTi", "STHeiti", sans-serif;
}

#hanzi span {
  font-size: 28px;
  margin-right: 4px;
  cursor: pointer;
  border-bottom: 1px dotted #888;
}

#english {
  font-size: 18px;
  line-height: 1.5;
  color: #555;
  margin-top: 10px;
}

#tooltip {
  position: absolute;
  display: none;
  background: #111;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  max-width: 300px;
  line-height: 1.4;
}

.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  color: inherit;
  padding: 40px;
  overflow: auto;
  z-index: 999;
}

.fullscreen #import-section,
.fullscreen textarea,
.fullscreen .controls {
  display: none;
}

/* Dark mode */
.darkmode {
  background-color: #121212;
  color: #f0f0f0;
}

.darkmode #settings-menu {
  background-color: #333;
  color: #f0f0f0;
  border: 1px solid #555;
}

.darkmode #reader {
  background-color: #222;
  color: #eee;
}

.darkmode #hanzi span {
  color: #eee;
}

.darkmode #english {
  color: #ddd;
}

.darkmode #tooltip {
  background-color: #333;
  color: #fff;
}