@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap");

:root {
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-ink: #0b3d36;
  --bg: #f3faf7;
  --bg-accent: rgba(16, 185, 129, 0.12);
  --surface: #ffffff;
  --text: #0f1c1a;
  --muted: #4b635e;
  --border: #d7ebe5;
  --warn-bg: #fff8e6;
  --warn-border: #e6c35c;
  --warn-text: #6b5300;
  --error: #a32020;
  --error-bg: #fdecec;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 10px 28px rgba(15, 118, 110, 0.08);
  --font: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --nav-width: 200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, var(--bg-accent), transparent 55%),
    linear-gradient(180deg, #ecf8f4 0%, var(--bg) 220px);
  min-height: 100vh;
}

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.site-header {
  margin-bottom: 1rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary-ink);
  text-decoration: none;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: min(200px, 55vw);
  object-fit: contain;
}

.brand-mark:hover {
  opacity: 0.92;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-chip:hover {
  background: #ecf8f4;
  border-color: #9ecfc3;
}

.site-intro h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-ink);
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 46rem;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.quota-hint {
  margin: 0 0 1rem;
  padding: 0.55rem 0.75rem;
  background: #ecf8f4;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  grid-template-areas: "nav main";
  gap: 1rem;
  align-items: start;
}

.tool-layout:has(.ad-rail) {
  grid-template-columns: var(--nav-width) minmax(0, 1fr) 160px;
  grid-template-areas: "nav main rail";
}

.tool-nav {
  grid-area: nav;
  position: sticky;
  top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

.tool-main {
  grid-area: main;
  min-width: 0;
}

.ad-rail {
  grid-area: rail;
  position: sticky;
  top: 1rem;
}

.tool-nav-label {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-nav-label:first-child {
  margin-top: 0;
}

.tool-nav-item {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.tool-nav-item:hover {
  background: #f4fbf8;
  color: var(--primary-ink);
}

.tool-nav-item.is-active {
  background: var(--primary);
  color: #fff;
}

.tool-nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 959px) {
  .tool-layout,
  .tool-layout:has(.ad-rail) {
    grid-template-columns: 1fr;
    grid-template-areas: "nav" "main" "rail";
  }

  .tool-nav {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.65rem;
    scrollbar-width: thin;
  }

  .tool-nav-label {
    display: none;
  }

  .tool-nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ad-rail {
    position: static;
    width: 100%;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem 1.6rem;
  box-shadow: var(--shadow);
}

.panel[hidden] {
  display: none !important;
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-ink);
}

.desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.desc a {
  color: var(--primary);
}

.warn {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  color: var(--warn-text);
  font-size: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.field > span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

input[type="file"],
textarea,
input[type="text"],
input[type="tel"],
input[type="password"],
.qr-form select {
  font: inherit;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fafcfb;
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 6rem;
}

input::placeholder,
textarea::placeholder {
  color: #a8bbb6;
  opacity: 1;
}

input[type="file"]:focus-visible,
textarea:focus-visible,
input[type="text"]:focus-visible,
input[type="tel"]:focus-visible,
input[type="password"]:focus-visible,
.btn:focus-visible,
.tool-nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 140px;
  padding: 1.25rem;
  border: 2px dashed #9ecfc3;
  border-radius: var(--radius);
  background: #f4fbf8;
  margin-bottom: 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dropzone.is-dragover {
  border-color: var(--primary);
  background: #ecf8f4;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.dropzone-title {
  font-weight: 700;
  color: var(--primary-ink);
}

.dropzone-hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.dropzone .field {
  width: 100%;
  max-width: 320px;
  margin-bottom: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.dedupe-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin: 0 0 0.85rem;
}

.dedupe-options .check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.dedupe-options .check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

#dedupe-stats {
  margin: 0 0 0.75rem;
}

.btn {
  appearance: none;
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: #ecf8f4;
}

.btn-secondary[hidden] {
  display: none !important;
}

.error {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.75rem;
  background: var(--error-bg);
  border: 1px solid #e8b0b0;
  border-radius: var(--radius);
  color: var(--error);
  font-size: 0.9rem;
}

.error[hidden] {
  display: none !important;
}

.qr-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.75rem;
  align-items: start;
}

.qr-preview-card,
.qr-settings {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 1rem;
}

.qr-preview-label,
.qr-settings-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.qr-preview-wrap {
  margin: 0;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4fbf8;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  overflow: auto;
  padding: 0.75rem;
}

.qr-placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.qr-placeholder[hidden] {
  display: none !important;
}

#qr-preview {
  width: auto;
  max-width: 100%;
  height: auto;
  border: none;
  border-radius: 0;
  background: #fff;
  padding: 0;
  image-rendering: pixelated;
}

#qr-preview[hidden] {
  display: none !important;
}

.qr-meta {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.qr-meta[hidden] {
  display: none !important;
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.qr-settings .hint {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.qr-form select {
  background: #fff;
}

@media (max-width: 720px) {
  .qr-layout {
    grid-template-columns: 1fr;
  }
}

.site-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0.35rem 0 0;
}

.footer-tools {
  text-align: left;
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.footer-title {
  margin: 0 0 0.5rem !important;
  font-weight: 700;
  color: var(--text);
}

.footer-tools ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
}

.footer-tools a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.footer-tools a:hover {
  text-decoration: underline;
}

.footer-meta {
  margin: 0.65rem 0 0;
}

.footer-meta a {
  color: var(--muted);
}

.footer-beian {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.footer-copyright {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-beian a {
  color: var(--muted);
  text-decoration: none;
}

.footer-beian a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.ad-slot {
  margin: 0.75rem 0;
  padding: 0.5rem;
  text-align: center;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ad-slot .ad-img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.ad-slot .ad-link {
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

.ad-header-below {
  max-height: 120px;
  overflow: hidden;
}

.ad-rail .ad-slot {
  margin: 0;
}

.ad-footer {
  margin-top: 1rem;
  margin-bottom: 0;
}

@media (max-width: 540px) {
  .site-intro h1 {
    font-size: 1.3rem;
  }

  .panel {
    padding: 1rem;
  }

  .brand-logo {
    height: 34px;
  }
}

/* Auth / account */
.auth-wrap {
  max-width: 440px;
}

.account-wrap {
  max-width: 720px;
}

.auth-hero {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-hero .brand-mark {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.auth-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-ink);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.auth-tab {
  flex: 1;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.auth-form label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-weight: 400;
  background: #fafcfb;
}

.code-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.code-row input {
  flex: 1;
}

.captcha-img {
  height: 44px;
  width: 140px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(145deg, #f7fcfa 0%, #eef8f4 100%);
  object-fit: contain;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.captcha-img:hover {
  border-color: #9ecfc3;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: #ecf8f4;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
}

.stat-card--accent {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.stat-label {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.stat-meta {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  opacity: 0.9;
}

.account-panel {
  margin-bottom: 1rem;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quota-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.quota-table th,
.quota-table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

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