:root {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: #17202a;
  background: #eef3f5;
  --ink: #17202a;
  --muted: #6a7480;
  --line: #d9e1e7;
  --paper: #ffffff;
  --deep: #101820;
  --teal: #0b8f8f;
  --amber: #d79a2b;
  --soft: #f4f8f9;
  --green: #2e8b57;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(11, 143, 143, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(215, 154, 43, 0.12), transparent 28%),
    #eef3f5;
  color: var(--ink);
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(16, 24, 32, 0.96), rgba(16, 24, 32, 0.72)),
    radial-gradient(circle at 80% 20%, rgba(11, 143, 143, 0.35), transparent 34%),
    #101820;
}

.auth-screen.hidden,
.hidden {
  display: none !important;
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.auth-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.auth-brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tabs button {
  min-height: 40px;
  border-radius: 8px;
  background: #eef3f5;
  color: var(--ink);
  font-weight: 800;
}

.auth-tabs button.active {
  background: var(--teal);
  color: #fff;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: #9b1c1c;
  font-size: 13px;
  line-height: 1.6;
}

.auth-note {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.auth-note strong {
  font-size: 13px;
}

.auth-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  display: grid;
  grid-template-columns: 288px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  background: #101820;
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  line-height: 1.25;
}

.brand span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(11, 143, 143, 0.28);
  color: #fff;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar h1,
.panel h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 30px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.top-actions button,
.result-head button,
.saved-item button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(420px, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 36px rgba(16, 24, 32, 0.08);
}

.compact {
  margin-top: auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.compact h2 {
  font-size: 15px;
}

.compact p {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.7;
}

.user-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 14px;
  padding-top: 12px;
}

.user-box span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.user-box button {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 12px;
}

.form-panel,
.result-panel,
.library-panel {
  padding: 18px;
}

.form-panel {
  display: grid;
  gap: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.content-card {
  display: grid;
  gap: 10px;
  border: 1px solid #cfe4e3;
  border-radius: 8px;
  padding: 12px;
  background: #f2fbfa;
}

.content-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.content-card-head strong {
  font-size: 14px;
}

.content-card-head span {
  border-radius: 999px;
  padding: 3px 8px;
  background: #dff2ef;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.content-card p {
  margin: 0;
  color: #4f5b66;
  font-size: 13px;
  line-height: 1.7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span {
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff;
  color: #34545a;
  font-size: 12px;
  border: 1px solid #d8eceb;
}

.quick-topics {
  display: grid;
  gap: 7px;
}

.quick-topics button {
  min-height: 32px;
  border: 1px solid #d8eceb;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
}

.quick-topics button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: #43505c;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 143, 143, 0.12);
}

.primary {
  min-height: 46px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.result-panel {
  min-height: calc(100vh - 112px);
}

.result-head,
.library-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}

.result-head h2,
.library-head h2 {
  font-size: 20px;
}

.result {
  display: grid;
  gap: 14px;
}

.output-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

.output-block h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.output-block p,
.output-block li {
  color: #4f5b66;
  line-height: 1.75;
}

.output-block p {
  margin: 0;
}

.output-block ul,
.output-block ol {
  margin: 0;
  padding-left: 22px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.timeline-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline-row strong {
  color: var(--teal);
}

.library-panel {
  min-height: calc(100vh - 112px);
}

.library-head span {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e6f4f4;
  color: var(--teal);
  font-weight: 900;
}

.library-list {
  display: grid;
  gap: 10px;
}

.saved-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.saved-item strong {
  font-size: 14px;
}

.saved-item span {
  color: var(--muted);
  font-size: 12px;
}

.saved-item button {
  justify-self: start;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

@media (max-width: 1180px) {
  .tool-grid {
    grid-template-columns: 380px 1fr;
  }

  .library-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: auto;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
