:root {
  color-scheme: light;
  --bg: #eef2ef;
  --panel: #ffffff;
  --panel-soft: #f8faf8;
  --ink: #17211f;
  --muted: #63716e;
  --faint: #8d9996;
  --line: #dce4e1;
  --line-strong: #cbd7d3;
  --teal: #0a7268;
  --teal-dark: #063f3b;
  --teal-soft: #e7f2ef;
  --gold: #a77b24;
  --red: #b75043;
  --sidebar: #11211f;
  --sidebar-muted: #9baba7;
  --shadow: 0 16px 38px rgba(23, 33, 31, 0.1);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0)),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px;
  background: var(--sidebar);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 7px;
  border-radius: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

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

.brand small {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav button {
  position: relative;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-muted);
  text-align: left;
}

.side-nav button span {
  color: #fff;
  font-weight: 800;
}

.side-nav button small {
  font-size: 12px;
}

.side-nav button:hover,
.side-nav button.active {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.side-nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 6px 6px 0;
  background: #62c3b7;
}

.side-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.side-note p {
  margin: 6px 0 0;
  color: var(--sidebar-muted);
  font-size: 13px;
}

.workspace {
  min-width: 0;
  padding: 18px clamp(18px, 3vw, 34px) 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  background: linear-gradient(180deg, var(--bg) 74%, rgba(238, 242, 239, 0));
}

.search {
  display: flex;
  width: min(820px, 100%);
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(23, 33, 31, 0.07);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 8px 0 0 8px;
  padding: 0 14px;
  outline: none;
}

.search button,
.top-actions button,
.primary-button,
.secondary-button,
.copy-button,
.mini-button {
  min-height: 36px;
  border-radius: 8px;
  font-weight: 800;
}

.search button,
.primary-button {
  border: 0;
  background: var(--teal);
  color: #fff;
}

.search button {
  margin: 5px;
  padding: 0 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

.top-actions button,
.secondary-button,
.copy-button,
.mini-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--teal-dark);
}

.top-actions button {
  padding: 0 12px;
}

.content-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.hero-copy-panel,
.status-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.hero-copy-panel {
  padding: 24px 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 10px;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.25;
}

#viewDesc {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.status-card {
  overflow: hidden;
}

.status-card img {
  display: block;
  width: 100%;
  height: 116px;
  object-fit: cover;
}

.status-card div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.status-card strong {
  font-size: 40px;
  line-height: 1;
}

.status-card span {
  color: var(--muted);
  font-weight: 800;
}

.panel {
  min-height: 460px;
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  padding: 6px 10px;
  color: var(--muted);
}

.mini-button.active,
.mini-button:hover {
  border-color: rgba(10, 114, 104, 0.22);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.tool-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.site-card,
.tool-card,
.template-card,
.calc-card,
.prompt-card,
.plan-card,
.quick-panel,
.search-hit {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  transition: 150ms ease;
}

.site-card:hover,
.tool-card:hover,
.template-card:hover,
.calc-card:hover,
.prompt-card:hover,
.search-hit:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 114, 104, 0.3);
  box-shadow: 0 10px 24px rgba(23, 33, 31, 0.08);
}

.tool-card {
  min-height: 132px;
  text-align: left;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 900;
}

.site-card {
  display: grid;
  gap: 9px;
  min-height: 148px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tag {
  align-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1eadc;
  color: #76571d;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.site-card p,
.tool-card p,
.template-card p,
.prompt-card p,
.plan-card p,
.search-hit p,
.quick-panel p {
  color: var(--muted);
}

.open-link {
  justify-self: start;
  color: var(--teal-dark);
  font-weight: 900;
}

.quick-panel {
  display: grid;
  gap: 10px;
  align-self: start;
  background: var(--panel-soft);
}

.quick-panel h3 {
  margin-bottom: 0;
}

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

.quick-list button,
.quick-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.quick-list small {
  color: var(--muted);
}

.calculator-layout,
.ai-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fee-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.fee-module {
  display: grid;
  gap: 8px;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  transition: 150ms ease;
}

.fee-module strong {
  font-size: 18px;
}

.fee-module small {
  color: var(--muted);
  line-height: 1.45;
}

.fee-module:hover,
.fee-module.active {
  border-color: rgba(10, 114, 104, 0.3);
  background: var(--teal-soft);
  box-shadow: 0 10px 24px rgba(23, 33, 31, 0.08);
}

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

.fee-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.fee-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.fee-detail-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.fee-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.calc-card label,
.prompt-card label,
.fee-form label {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.fee-form label {
  margin: 0;
}

.calc-note {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 13px;
}

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

textarea {
  resize: vertical;
}

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

.split-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.primary-button,
.secondary-button,
.copy-button {
  width: 100%;
  padding: 8px 12px;
}

output {
  display: block;
  min-height: 52px;
  margin-top: 12px;
  padding: 11px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 800;
}

.template-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
}

.template-card .copy-button {
  align-self: end;
}

.prompt-card {
  grid-column: span 2;
}

.price {
  color: var(--red) !important;
  font-size: 28px;
  font-weight: 900;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-hit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.search-hit h3,
.search-hit p {
  margin-bottom: 4px;
}

.empty {
  padding: 34px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  transform: translateY(16px);
  opacity: 0;
  min-width: 220px;
  max-width: calc(100vw - 36px);
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--teal-dark);
  color: #fff;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .side-nav button {
    min-width: 138px;
  }

  .side-note {
    display: none;
  }

  .content-header,
  .home-layout,
  .fee-module-grid,
  .fee-form,
  .calculator-layout,
  .ai-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-card {
    grid-column: auto;
  }

  .content-header,
  .home-layout,
  .calculator-layout,
  .ai-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 12px;
  }

  .topbar {
    display: grid;
  }

  .top-actions {
    justify-content: space-between;
  }

  .search {
    display: grid;
  }

  .search input {
    min-height: 46px;
    border-radius: 8px 8px 0 0;
  }

  .search button {
    min-height: 42px;
    border-radius: 0 0 8px 8px;
  }

  .tool-grid,
  .card-grid,
  .fee-module-grid,
  .fee-form {
    grid-template-columns: 1fr;
  }

  .section-title,
  .search-hit {
    display: block;
  }

  h1 {
    font-size: 34px;
  }
}
