[hidden] {
  display: none !important;
}
:root {
  font-family:
    system-ui,
    -apple-system,
    "Noto Sans TC",
    sans-serif;
  color: #242c3b;
  background: #f6f5f1;
  font-synthesis: none;
  line-height: 1.65;
  --primary: #375b59;
  --muted: #707983;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #dddfd8;
  background: #fcfcfa;
}
.brand {
  font-size: 27px;
  font-weight: 650;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.03em;
}
.brand small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 15px;
}
main {
  max-width: 1180px;
  margin: 30px auto;
  padding: 0 24px;
}
h1 {
  font-size: 28px;
  margin: 12px 0 5px;
}
h2 {
  font-size: 20px;
  margin: 0 0 15px;
}
h3 {
  font-size: 16px;
  margin: 0 0 10px;
}
p {
  margin: 8px 0 18px;
}
.muted,
small {
  color: var(--muted);
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}
button,
.button {
  font: inherit;
  border: 1px solid #d5dcd8;
  background: white;
  color: var(--primary);
  padding: 8px 15px;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  background: #edf2ef;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary,
nav button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
button.danger {
  color: #9c4641;
}
.card {
  background: #fff;
  border: 1px solid #e0e3dc;
  border-radius: 12px;
  padding: 23px;
  margin: 16px 0;
  box-shadow: 0 3px 10px #24303003;
}
.login {
  max-width: 450px;
  margin: 65px auto;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.metric {
  font-size: 32px;
  font-weight: 650;
  color: var(--primary);
}
label {
  display: block;
  font-size: 14px;
  margin: 10px 0 15px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  font: inherit;
  padding: 10px;
  border: 1px solid #cfd8d3;
  border-radius: 6px;
  background: #fff;
  margin-top: 5px;
  color: inherit;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.badge {
  background: #edf2ef;
  color: var(--primary);
  font-size: 12px;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}
.badge.warn {
  background: #fff0d7;
  color: #8d6028;
}
.badge.bad {
  background: #f9e9e5;
  color: #9b4842;
}
.scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
td,
th {
  padding: 13px 10px;
  text-align: left;
  border-bottom: 1px solid #e6e8e2;
  vertical-align: top;
}
td.wrap {
  min-width: 220px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
th {
  font-weight: 500;
  color: var(--muted);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    12px ui-monospace,
    monospace;
}
details {
  border-top: 1px solid #e6e8e2;
  padding-top: 12px;
  margin-top: 12px;
}
summary {
  cursor: pointer;
  color: var(--primary);
}
#notice {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 10px 10px 10px 16px;
  background: #eef4f0;
  border: 1px solid #b7ccbb;
  border-radius: 9px;
  box-shadow: 0 8px 25px #24303020;
}
#notice.error {
  background: #fcebe7;
  border-color: #e5b7ad;
}
#notice-text {
  flex: 1;
  padding-top: 7px;
}
#notice .icon-button {
  border: 0;
  background: none;
}
footer {
  text-align: center;
  font-size: 12px;
  color: #8c938d;
  padding: 35px;
}
.empty {
  text-align: center;
  padding: 30px;
  color: var(--muted);
}
.portrait {
  height: 180px;
  border-radius: 6px;
}
code {
  font-size: 12px;
}
a {
  color: var(--primary);
}
@media (max-width: 760px) {
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }
  header {
    padding: 15px 20px;
  }
  .brand small {
    display: none;
  }
  main {
    padding: 0 16px;
  }
  .card {
    padding: 18px;
  }
  h1 {
    font-size: 24px;
  }
}
/* Compact owner tools */
main {
  margin-top: 18px;
}
nav {
  margin-top: 0;
}
.settings {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
#updated-at {
  font-size: 13px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  line-height: 1;
  min-width: 36px;
  min-height: 36px;
}
.icon-button[data-copied="true"] {
  color: #fff;
  background: var(--primary);
}
.icon-button[data-copied="true"]::after {
  content: "已複製";
  margin-left: 5px;
  font-size: 12px;
}
.settings-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 15;
  width: 230px;
  padding: 8px;
  border: 1px solid #d5dcd8;
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 25px #24303020;
}
.settings-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
}
#version-info {
  display: block;
  white-space: pre-line;
  padding: 10px;
  margin-top: 6px;
  border-top: 1px solid #e6e8e2;
  font-size: 11px;
}
.translation-entry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
dialog {
  width: min(820px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  color: inherit;
  border: 1px solid #d5dcd8;
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 16px 70px #24303030;
}
dialog::backdrop {
  background: #172e2b70;
}
dialog h2 {
  margin: 0;
}
#password-dialog,
#publish-dialog {
  max-width: 560px;
}
#translation-dialog textarea {
  min-height: 230px;
}
.translation-languages {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.translation-languages button {
  margin-top: 15px;
}
#translation-status,
#password-status {
  margin: 14px 0 0;
}
#password-status {
  color: #9c4641;
}
.text-tools {
  display: flex;
  gap: 5px;
  align-items: center;
}
.job-text {
  min-width: 0;
  margin-top: 10px;
}
.job-text > .row strong {
  font-size: 13px;
  font-weight: 500;
}
.original-text,
.translated-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.inline-translation {
  background: #f1f5f1;
  border-left: 3px solid #a6beb5;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0 18px;
}
.inline-translation label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.inline-translation select {
  width: auto;
  margin: 0;
  padding: 5px;
}
.inline-translation small {
  display: block;
}
.event-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 330px;
  margin: 12px 0;
  border-radius: 7px;
}
.image-upload {
  border: 1px dashed #c5d2ca;
  border-radius: 8px;
  padding: 0 16px 16px;
  margin: 14px 0;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .translation-entry {
    margin-left: 0;
  }
  dialog {
    padding: 18px;
  }
  #translation-dialog textarea {
    min-height: 150px;
  }
  .translation-languages {
    gap: 8px;
  }
}

.publication-diagnostics {
  margin-top: 1rem;
}
.diagnostic-record {
  border-top: 1px solid var(--line, #e3e6e4);
  padding: 1rem 0;
  overflow-wrap: anywhere;
}
.diagnostic-record dl {
  font-size: 0.85rem;
}
.diagnostic-record dt {
  color: #657770;
  margin-top: 0.5rem;
}
.diagnostic-record dd {
  margin: 0.2rem 0;
}

.tool-card-preview {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.button-link {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #cbd7d3;
  border-radius: 6px;
  text-decoration: none;
}
.skipped-comment {
  padding: 14px 0;
  border-top: 1px solid #e3e6e4;
}
.intake-source {
  display: block;
  color: #5d6b66;
}
.badge.muted-badge {
  background: #eef0ef;
  color: #4a5551;
}
#reading-tool-result {
  margin-top: 24px;
}
#tone-form {
  scroll-margin-top: 20px;
}
#card-tool > button {
  align-self: end;
  margin-bottom: 15px;
}
.span-two {
  grid-column: 1 / -1;
}
#meihua-reading-result {
  margin-top: 24px;
}
.tool-card-preview > div {
  flex: 1 1 320px;
}
.hexagram-symbol {
  font-size: 1.6em;
  line-height: 1;
  vertical-align: -0.15em;
}
.hexagram-title {
  font-size: 18px;
  font-weight: 600;
}
.hexagram-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  font-size: 14px;
}
.hexagram-facts dt {
  color: var(--muted);
}
.hexagram-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.meihua-dictionary > summary {
  font-weight: 600;
}
.meihua-dictionary td {
  white-space: nowrap;
}
.meihua-dictionary td.wrap {
  white-space: normal;
}
.meihua-dictionary td details {
  border: 0;
  margin: 0;
  padding: 0;
}
p.error {
  color: #9b2c2c;
}
.portrait.hexagram-preview {
  width: min(100%, 300px);
  height: auto;
}
.warning-box {
  margin: 14px 0;
  padding: 12px 16px;
  border: 1px solid #e3c27a;
  border-radius: 9px;
  background: #fff6e0;
  color: #5c4310;
}
.warning-box ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.login-brand {
  color: var(--primary);
  font-weight: 650;
  letter-spacing: 0.03em;
}
pre.command {
  background: #f1f4f1;
  border: 1px solid #dde4de;
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
pre.command code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.pw-field {
  margin: 10px 0 15px;
}
.pw-field > label {
  margin: 0 0 6px;
}
.pw-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: 370px;
}
.pw-input-wrap {
  position: relative;
}
.pw-cells {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.pw-cell {
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid #cfd8d3;
  border-radius: 8px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  color: inherit;
}
.pw-cell.filled {
  border-color: #9fb5ad;
}
.pw-cell.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px #375b5926;
}
.pw-field.invalid .pw-cell {
  border-color: #d59a8f;
}
/* The real input sits over the cells; only the cells are visible. */
input.pw-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  cursor: text;
}
input.pw-input:focus {
  outline: none;
}
input.pw-input::selection {
  background: transparent;
}
.pw-count {
  display: block;
  margin-top: 4px;
}
p.pw-error {
  margin: 4px 0 0;
  font-size: 14px;
}
.attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.attention-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid #e0e3dc;
}
.attention-list li p {
  margin: 4px 0 0;
}
.tool-card-preview .portrait.planet-card {
  width: min(100%, 260px);
  height: auto;
}
.portrait.spread-card {
  width: min(100%, 360px);
  height: auto;
}
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  vertical-align: -1px;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}
.pager label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.pager input {
  width: 84px;
  margin-top: 0;
}
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 20px;
  border-bottom: 1px solid #dddfd8;
}
.subnav a {
  padding: 8px 2px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.subnav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.back-link {
  display: inline-block;
  margin-bottom: 12px;
}
.links {
  display: inline-flex;
  gap: 16px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}
.filters label {
  flex: 1 1 150px;
  margin: 0;
}
.filters a {
  padding-bottom: 11px;
}
.notice-button {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}
.job-row {
  cursor: pointer;
}
.job-row:hover {
  background: #f4f6f2;
}
.job-row td {
  vertical-align: middle;
}
.job-row .row-toggle {
  border: 0;
  background: none;
  min-width: 28px;
  min-height: 28px;
  padding: 4px;
}
.job-row.open .row-toggle svg {
  transform: rotate(90deg);
}
.job-table td.clip {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-detail > td {
  padding: 16px 20px 22px;
  background: #fafaf7;
}
.job-manual {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #dddfd8;
}
.job-manual form {
  max-width: 720px;
}
.job-manual textarea {
  min-height: 76px;
}
.job-manual form > small {
  display: block;
  margin-top: 10px;
}
.manual-history {
  padding-left: 22px;
}
.manual-history li {
  margin: 12px 0;
}
.manual-history small {
  display: block;
}
.manual-history p {
  margin: 4px 0;
}
