:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-soft: #fbfbf7;
  --ink: #16211d;
  --text: #25302b;
  --muted: #66706b;
  --line: #e4e8e1;
  --line-strong: #d4dbcF;
  --green: #6db844;
  --green-deep: #0f3a2d;
  --green-soft: #eef8e9;
  --pink: #d6508a;
  --pink-dark: #bf3f78;
  --pink-soft: #fff0f7;
  --gold: #f0c052;
  --danger: #b42318;
  --ok: #167a46;
  --shadow: 0 18px 48px rgba(22, 33, 29, 0.08);
  --shadow-soft: 0 8px 22px rgba(22, 33, 29, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(238, 248, 233, 0.46), rgba(247, 248, 245, 0) 320px),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 13px max(24px, calc((100vw - 1240px) / 2));
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 116px;
  height: auto;
  flex: 0 0 auto;
}

.brand-caption {
  margin: 0;
  padding-left: 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  transform: translateY(6px);
  white-space: nowrap;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.18;
}

h1 {
  font-size: 21px;
  font-weight: 850;
}

h2 {
  font-size: 30px;
  font-weight: 850;
}

h3 {
  font-size: 17px;
  font-weight: 850;
}

.eyebrow,
.section-label,
.mini-label {
  margin: 0 0 7px;
  color: var(--pink);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.topline {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill,
.logout {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.status-pill {
  color: var(--green-deep);
  background: var(--green-soft);
  border: 1px solid rgba(109, 184, 68, 0.2);
}

.logout {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}

.logout:hover {
  color: var(--green-deep);
  border-color: rgba(15, 58, 45, 0.22);
}

.login-wrap,
.app-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 56px;
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: 54px 0;
}

.login-intro {
  min-width: 0;
  max-width: 620px;
}

.login-intro h2 {
  max-width: 12em;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.login-intro h2 span {
  display: block;
}

.login-intro > p {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.intro-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.intro-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--green-deep);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 800;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  gap: 9px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.login-logo {
  width: 132px;
  height: auto;
  margin-bottom: 4px;
}

.login-copy,
.workspace-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.app-shell {
  padding: 30px 0 52px;
}

.panel {
  background: transparent;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  min-height: 38px;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.tab.is-active {
  background: var(--green-deep);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 58, 45, 0.15);
}

.tool-form {
  margin-top: 18px;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 386px;
  gap: 18px;
  align-items: start;
}

.form-main,
.control-panel,
.upload-panel {
  display: grid;
  gap: 16px;
}

.field-card,
.control-panel,
.upload-panel,
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.field-card {
  padding: 20px;
}

.field-head,
.control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.field-badge,
.settings-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--green-deep);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.field-card.compact {
  padding: 18px 20px;
}

.control-panel,
.upload-panel {
  padding: 20px;
}

.control-panel {
  position: sticky;
  top: 94px;
}

.control-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.control-block {
  display: grid;
  gap: 9px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.control-block:last-of-type {
  border-bottom: 0;
}

.emotion-row {
  margin: 14px 0 0;
  padding: 14px;
  background: linear-gradient(180deg, #fffafc, #ffffff);
  border: 1px solid rgba(214, 80, 138, 0.22);
  border-radius: 8px;
}

.mini-label {
  margin-bottom: 2px;
  color: var(--green-deep);
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 11px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  outline: 3px solid rgba(109, 184, 68, 0.16);
}

textarea {
  min-height: 360px;
  resize: vertical;
  line-height: 1.6;
}

input[type="range"] {
  accent-color: var(--pink);
  padding: 0;
}

button,
.download,
.button-secondary {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
}

button,
.download {
  background: var(--pink);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(214, 80, 138, 0.16);
}

button:hover,
.download:hover {
  background: var(--pink-dark);
}

.button-secondary {
  width: fit-content;
  color: var(--green-deep);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.button-secondary:hover {
  background: var(--green-soft);
  border-color: rgba(109, 184, 68, 0.42);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.primary {
  width: 100%;
  min-height: 48px;
}

.generate-button {
  margin-top: 6px;
}

.hint,
.voice-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.voice-note {
  width: fit-content;
  padding: 6px 10px;
  color: var(--green-deep);
  background: var(--green-soft);
  border: 1px solid rgba(109, 184, 68, 0.22);
  border-radius: 999px;
  font-weight: 850;
}

.range-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.result {
  margin-top: 18px;
  padding: 18px 20px;
}

.result-card {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.result-title {
  margin: 0;
  font-size: 18px;
  font-weight: 850;
}

audio {
  width: 100%;
}

.error {
  color: var(--danger);
  margin: 0;
  font-weight: 750;
}

.ok {
  color: var(--ok);
}

.file-input {
  padding: 18px;
  border: 1px dashed rgba(15, 58, 45, 0.24);
  border-radius: 8px;
  background: var(--surface-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 850;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .login-layout,
  .form-layout {
    grid-template-columns: 1fr;
  }

  .login-layout {
    gap: 28px;
    min-height: auto;
  }

  .login-intro h2 {
    max-width: 13em;
  }

  .control-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar,
  .brand-lockup,
  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 14px 18px;
  }

  .topbar-actions,
  .tabs {
    width: 100%;
  }

  .status-pill,
  .logout {
    justify-content: center;
  }

  .logout {
    margin-left: auto;
  }

  .brand-logo {
    width: 112px;
  }

  .brand-caption {
    padding-left: 0;
    border-left: 0;
    transform: translateY(0);
    white-space: normal;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 25px;
  }

  .login-wrap,
  .app-shell {
    width: min(100% - 24px, 1240px);
  }

  .login-layout {
    padding: 28px 0;
  }

  .login-intro h2 {
    max-width: 100%;
    font-size: 26px;
    line-height: 1.2;
  }

  .login-intro > p {
    font-size: 15px;
  }

  .login-panel,
  .workspace-head,
  .field-card,
  .control-panel,
  .upload-panel,
  .result {
    padding: 18px;
  }

  .field-head,
  .control-head {
    flex-direction: column;
    gap: 8px;
  }

  textarea {
    min-height: 260px;
  }

  .tab {
    flex: 1;
    padding: 0 10px;
  }
}
