:root {
  --bg-1: #f8f4e8;
  --bg-2: #ebf2ef;
  --ink: #1f2a2e;
  --muted: #5c6a70;
  --panel: #fffdf7;
  --line: #d9d3c4;
  --brand: #156f68;
  --brand-2: #d17a27;
  --danger: #8d1b1b;
  --token: #fef7e7;
  --token-connector: #e7f6f3;
  --token-punct: #f0f0f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', serif;
  color: var(--ink);
  background: linear-gradient(120deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
  position: relative;
}

.bg-shape {
  position: fixed;
  border-radius: 9999px;
  filter: blur(50px);
  opacity: 0.35;
  pointer-events: none;
}

.bg-a {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -80px;
  background: #ffe1be;
}

.bg-b {
  width: 260px;
  height: 260px;
  right: -60px;
  bottom: 20%;
  background: #b8e3db;
}

.topbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 8px;
}

.topbar h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 1px;
}

.topbar p {
  margin: 8px 0 10px;
  color: var(--muted);
}

.topbar nav {
  display: flex;
  gap: 14px;
}

.topbar a {
  color: var(--brand);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
}

.topbar a.nav-current {
  background: #d9eee8;
  font-weight: 700;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6px 16px 28px;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
  animation: rise 280ms ease-out;
}

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.settings-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

textarea {
  line-height: 1.6;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.btn.btn-secondary {
  background: #5f6f79;
}

.btn.btn-accent {
  background: var(--brand-2);
}

.btn.btn-danger {
  background: var(--danger);
}

.btn.btn-hold-active {
  background: #b65012;
}

.status {
  font-size: 13px;
  color: var(--muted);
}

.mic-indicator {
  margin: 4px 0 10px;
}

.volume-meter {
  width: 100%;
  max-width: 320px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid #cdd7d5;
  background: #eef4f2;
  overflow: hidden;
}

.volume-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2a9d8f, #e9c46a, #e76f51);
  transition: width 90ms linear;
}

.token-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 46px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.token-chip {
  border: 1px solid #d9ccb2;
  background: var(--token);
  border-radius: 999px;
  font-size: 14px;
  padding: 4px 10px;
  cursor: pointer;
}

.token-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.token-chip.editing,
.token-chip-input {
  background: #e5e5e5;
  border-color: #bebebe;
  color: #454545;
}

.token-zone .token-chip-input {
  width: auto;
  min-width: 42px;
  max-width: 220px;
  outline: none;
}

.token-zone .token-chip-input:focus {
  box-shadow: 0 0 0 2px rgba(21, 111, 104, 0.15);
}

.token-candidate-select {
  width: auto;
  max-width: 120px;
  min-width: 58px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #c9c9c9;
  font-size: 12px;
  background: #f5f5f5;
}

.token-chip.connector {
  background: var(--token-connector);
  border-color: #b9ddd6;
}

.token-chip.punct {
  background: var(--token-punct);
  border-color: #ddd;
}

.token-chip.space {
  background: #f5f5f5;
  border-style: dashed;
}

.logs {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
  background: #fcfcfc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.inline-check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #ece4d5;
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
}

.simple-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

@media (max-width: 768px) {
  .topbar h1 {
    font-size: 26px;
  }

  .panel {
    padding: 12px;
  }

  .btn {
    width: 100%;
  }
}
