:root {
  --bg: #f4efe7;
  --panel: rgba(255, 252, 247, 0.88);
  --ink: #172220;
  --muted: #5e6b67;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --line: rgba(23, 34, 32, 0.12);
  --shadow: 0 22px 70px rgba(22, 36, 33, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 36%),
    radial-gradient(circle at bottom right, rgba(180, 83, 9, 0.12), transparent 32%),
    linear-gradient(135deg, #f6f2ea 0%, #efe6d7 100%);
}

.page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 40px;
}

.hero {
  margin-bottom: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.lang-form {
  margin: 0;
}

.lang-form label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding-top: 0;
}

.login-panel {
  width: min(520px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.9rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.subtitle {
  margin: 18px 0 0;
  max-width: 640px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 10px;
}

.field > span {
  font-size: 0.95rem;
  font-weight: 700;
}

input[type="file"],
input[type="text"],
input[type="password"],
select,
.readonly-format {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.readonly-format {
  font-weight: 800;
  letter-spacing: 0.02em;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  color: white;
  background: var(--accent);
  cursor: pointer;
}

small {
  color: var(--muted);
  line-height: 1.5;
}

button {
  width: fit-content;
  min-width: 180px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.72;
  cursor: progress;
  transform: none;
}

.status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
}

.ai-result {
  margin: 0;
  padding: 18px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 18px;
  font: inherit;
  line-height: 1.7;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
}

.compact {
  max-width: 100%;
  margin-top: 8px;
}

.section-head {
  margin-bottom: 18px;
}

.card-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature-card,
.feature-link,
.faq-item {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.feature-card h3,
.faq-item h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.feature-card p,
.faq-item p,
.feature-link {
  margin: 0;
  line-height: 1.6;
}

.feature-link,
.text-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.simple-list p {
  margin: 0 0 12px;
  line-height: 1.7;
}

.step-list {
  margin: 0;
  padding-left: 22px;
  line-height: 1.8;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.error-message {
  margin: 0;
  color: #b91c1c;
  font-weight: 700;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.metric-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.metric-card h2,
.table-panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.metric-card p {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.table-panel {
  margin-top: 24px;
  overflow-x: auto;
}

.ad-panel {
  margin-top: 24px;
}

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

.seo-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
}

.seo-actions form {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.95rem;
}

th {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 640px) {
  .page {
    padding-top: 44px;
  }

  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .topbar {
    align-items: flex-start;
  }

  button {
    width: 100%;
  }
}
