/* ============================================================
   YourTools User Manual — Style
   Design: Minimal · Premium · Clean
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --color-bg:          #f9fafb;
  --color-surface:     #ffffff;
  --color-border:      #e5e7eb;
  --color-border-hover:#d1d5db;
  --color-text:        #111827;
  --color-text-secondary: #6b7280;
  --color-text-tertiary:  #9ca3af;
  --color-accent:      #4f46e5;
  --color-accent-soft: #eef2ff;
  --color-accent-dark: #4338ca;
  --color-success:     #059669;
  --color-success-soft:#ecfdf5;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display",
               "Segoe UI", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans JP", "Helvetica Neue",
               Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code",
               "Cascadia Code", Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);

  --transition-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Layout --- */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Header --- */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.82);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
}

.logo-img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* --- Language Switcher --- */
.lang-switcher {
  position: relative;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-current:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg);
}

.lang-current .lang-arrow {
  font-size: 10px;
  color: var(--color-text-secondary);
  transition: transform var(--transition-fast);
}

.lang-switcher.open .lang-current .lang-arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.lang-option:hover {
  background: var(--color-accent-soft);
}

.lang-option.active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-weight: 600;
}

.lang-option .lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.lang-option.active .lang-dot {
  opacity: 1;
}

/* --- Hero --- */
.hero {
  padding: 60px 0 48px;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  padding: 4px 12px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--color-text);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.65;
}

/* --- Search --- */
.search-wrapper {
  margin-bottom: 40px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-icon {
  color: var(--color-text-tertiary);
  margin-right: 10px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: transparent;
}

.search-input::placeholder {
  color: var(--color-text-tertiary);
}

.search-clear {
  display: none;
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.search-clear:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.search-clear.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- FAQ Section --- */
.faq-section {
  padding-bottom: 80px;
}

.faq-list {
  display: flex;
  flex-direction: column;
}

/* --- FAQ Item --- */
.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.faq-item:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}

.faq-item.active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.06), var(--shadow-md);
}

.faq-item.hidden-by-search {
  display: none;
}

/* --- FAQ Header (clickable) --- */
.faq-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}

.faq-header:hover {
  background: rgba(0, 0, 0, 0.015);
}

.faq-number {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-tertiary);
  transition: all var(--transition-fast);
}

.faq-item.active .faq-number {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.faq-question {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
  padding-top: 3px;
}

.faq-chevron {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: transform var(--transition-smooth);
  margin-top: 2px;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--color-accent);
}

/* --- FAQ Body (expandable) --- */
.faq-body-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-smooth);
}

.faq-item.active .faq-body-wrapper {
  grid-template-rows: 1fr;
}

.faq-body-inner {
  overflow: hidden;
}

.faq-body-content {
  padding: 0 22px 22px 66px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text-secondary);
  overflow-wrap: break-word;
  word-break: break-word;
}

/* --- Screenshot Placeholder --- */
.screenshot-placeholder {
  margin-top: 18px;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: var(--color-text-tertiary);
  font-size: 13px;
  transition: border-color var(--transition-fast);
  overflow: hidden;
}

.screenshot-placeholder:hover {
  border-color: var(--color-accent);
}

.screenshot-placeholder img {
  width: 76%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

.screenshot-placeholder .placeholder-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.screenshot-placeholder .placeholder-icon {
  font-size: 28px;
  opacity: 0.5;
}

/* --- Format Tags (FAQ 2) --- */
.format-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.format-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.format-tag:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* --- Steps (ordered list inside FAQ) --- */
.faq-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
}

.faq-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
}

.faq-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- No Results --- */
.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-tertiary);
  display: none;
}

.no-results.visible {
  display: block;
}

.no-results-icon {
  font-size: 40px;
  margin-bottom: 14px;
}

.no-results-text {
  font-size: 15px;
}

/* --- Footer --- */
.footer {
  margin-top: auto;
  padding: 28px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-text {
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.footer-text a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-text a:hover {
  color: var(--color-accent);
}

/* --- Responsive --- */

/* Tablet & below */
@media (max-width: 768px) {
  .container {
    padding: 0 18px;
  }

  .hero {
    padding: 44px 0 32px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .faq-header {
    padding: 18px 16px;
    gap: 12px;
  }

  .faq-body-content {
    padding: 0 16px 18px 58px;
  }

  .faq-question {
    font-size: 14px;
  }

  .faq-body-content {
    font-size: 14px;
  }

  .screenshot-placeholder {
    min-height: 140px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .header-inner {
    height: 54px;
  }

  .logo-text {
    font-size: 16px;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .hero-title {
    font-size: 23px;
    letter-spacing: -0.5px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .search-box {
    padding: 10px 14px;
    border-radius: var(--radius-md);
  }

  .search-input {
    font-size: 14px;
  }

  .faq-header {
    padding: 16px 14px;
    gap: 10px;
  }

  .faq-body-content {
    padding: 0 14px 16px 50px;
    font-size: 13px;
  }

  .faq-number {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .faq-question {
    font-size: 14px;
  }

  .faq-item {
    margin-bottom: 8px;
  }

  /* Move lang dropdown to left on mobile to avoid overflow */
  .lang-dropdown {
    right: auto;
    left: 0;
  }

  .format-tags {
    gap: 6px;
  }

  .format-tag {
    font-size: 11px;
    padding: 3px 8px;
  }

  .screenshot-placeholder {
    min-height: 120px;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
