/* ========================================
   SUSHI.TOP - 日系极简寿司百科样式表
   ======================================== */

/* CSS Variables */
:root {
  --white: #FFFFFF;
  --cream: #F5F3EF;
  --light-gray: #FAFAF8;
  --sage-green: #8BA888;
  --sage-light: #A8C5A0;
  --sage-dark: #6B8B6A;
  --text-primary: #2D2D2D;
  --text-secondary: #5A5A5A;
  --text-muted: #8A8A8A;
  --border: #E8E6E2;
  --shadow: rgba(0, 0, 0, 0.05);
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text-primary);
  background-color: var(--white);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

a {
  color: var(--sage-green);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--sage-dark);
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
  padding: 2rem 0;
}

/* Header & Navigation */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

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

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.logo-text span {
  color: var(--sage-green);
}

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

.nav-link {
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-radius: 6px;
  transition: all var(--transition);
}

.nav-link:hover {
  background: var(--cream);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--sage-green);
  color: var(--white);
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  background: var(--cream);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
  max-width: 280px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  width: 100%;
  color: var(--text-primary);
}

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

.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-primary);
  padding: 0.5rem;
}

/* Hero Section */
.hero {
  background: var(--cream);
  padding: 4rem 0;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.hero-title span {
  color: var(--sage-green);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 2rem;
}

.hero-banner {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto;
  box-shadow: 0 2px 12px var(--shadow);
}

.hero-banner p {
  font-size: 1rem;
  margin-bottom: 0;
}

/* Section */
.section {
  padding: 3rem 0;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 1.5rem;
  background: var(--sage-green);
  border-radius: 2px;
}

.view-all {
  font-size: 0.9rem;
  color: var(--sage-green);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card-grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all var(--transition);
  cursor: pointer;
}

.card:hover {
  border-color: var(--sage-light);
  box-shadow: 0 4px 16px var(--shadow);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Tool Cards */
.tool-card {
  background: var(--cream);
  border: 2px solid var(--sage-light);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
}

.tool-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.tool-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.tool-card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.tool-card-btn {
  display: inline-block;
  background: var(--sage-green);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.tool-card-btn:hover {
  background: var(--sage-dark);
  color: var(--white);
}

/* Tool Layout */
.tools-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.tool-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.tool-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Calculator */
.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--sage-green);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--sage-green);
  color: var(--white);
}

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

.btn-secondary {
  background: var(--cream);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.result-box {
  background: var(--cream);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.result-item {
  text-align: center;
  padding: 1rem;
  background: var(--white);
  border-radius: 8px;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--sage-green);
}

.result-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Quiz */
.quiz-container {
  max-width: 600px;
  margin: 0 auto;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.quiz-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--sage-green);
  transition: width 0.3s ease;
}

.quiz-progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 50px;
}

.quiz-question {
  text-align: center;
  margin-bottom: 2rem;
}

.quiz-question h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.quiz-option {
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.quiz-option:hover {
  border-color: var(--sage-light);
  background: var(--white);
}

.quiz-option.selected {
  border-color: var(--sage-green);
  background: var(--white);
}

.quiz-option-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.quiz-option-text {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Quiz Result */
.quiz-result {
  text-align: center;
  padding: 2rem;
}

.quiz-result-badge {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.quiz-result-name {
  font-size: 1.75rem;
  color: var(--sage-green);
  margin-bottom: 0.5rem;
}

.quiz-result-desc {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.quiz-share {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Encyclopedia */
.encyclopedia-intro {
  background: var(--cream);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
  text-align: center;
}

.encyclopedia-intro h2 {
  margin-bottom: 1rem;
}

.category-section {
  margin-bottom: 3rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.category-icon {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  background: var(--cream);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.item-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all var(--transition);
}

.item-card:hover {
  border-color: var(--sage-light);
  box-shadow: 0 2px 12px var(--shadow);
}

.item-card h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.item-card p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.item-tag {
  display: inline-block;
  background: var(--cream);
  color: var(--sage-dark);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

/* Term Section */
.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.term-card {
  background: var(--cream);
  border-radius: 12px;
  padding: 1.25rem;
}

.term-japanese {
  font-size: 1.25rem;
  color: var(--sage-green);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.term-reading {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.term-meaning {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Tutorial */
.tutorial-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all var(--transition);
}

.tutorial-card:hover {
  border-color: var(--sage-light);
  box-shadow: 0 4px 16px var(--shadow);
}

.tutorial-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tutorial-card-icon {
  font-size: 2.5rem;
}

.tutorial-card-title {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.tutorial-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tutorial-card-content {
  padding-left: 4rem;
}

.tutorial-card-content ul {
  list-style: none;
  padding: 0;
}

.tutorial-card-content li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tutorial-card-content li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--sage-green);
}

/* Recipe */
.recipe-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition);
}

.recipe-card:hover {
  border-color: var(--sage-light);
  box-shadow: 0 4px 16px var(--shadow);
}

.recipe-card-body {
  padding: 1.5rem;
}

.recipe-card-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.recipe-ingredients {
  background: var(--cream);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.recipe-ingredients h4 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.recipe-ingredients ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

.recipe-ingredients li {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.recipe-steps {
  counter-reset: step;
}

.recipe-steps li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.recipe-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--sage-green);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tip Card */
.tip-card {
  background: var(--cream);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
}

.tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tip-content h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.tip-content p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--sage-green);
}

.breadcrumb span {
  color: var(--text-muted);
}

/* Feedback Section */
.feedback-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.feedback-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
}

.feedback-form textarea {
  min-height: 120px;
  resize: vertical;
}

.feedback-list {
  margin-top: 1.5rem;
}

.feedback-item {
  background: var(--cream);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.feedback-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.feedback-item-author {
  font-size: 0.85rem;
  font-weight: 500;
}

.feedback-item-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.feedback-item-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Footer */
.footer {
  background: var(--cream);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--sage-green);
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .search-box {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin-top: 0.5rem;
    display: none;
  }

  .search-box.active {
    display: flex;
  }

  .nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    padding: 1rem 0;
    gap: 0.25rem;
  }

  .nav.active {
    display: flex;
  }

  .nav-link {
    width: 100%;
    text-align: center;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    padding: 2.5rem 0;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-banner {
    padding: 1.5rem;
  }

  .section {
    padding: 2rem 0;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .tools-layout {
    grid-template-columns: 1fr;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

  .result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .recipe-ingredients ul {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  .container {
    padding: 0 1rem;
  }

  .hero-banner {
    padding: 1rem;
  }

  .tool-section {
    padding: 1.5rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  .header, .footer, .nav, .search-box, .feedback-section {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.6;
  }

  .card, .item-card, .term-card {
    break-inside: avoid;
  }
}

/* Logo Image */
.logo-img {
  height: 40px;
  width: auto;
  border-radius: 4px;
}

/* Translate Button */
.translate-btn {
  position: relative;
}

.translate-btn button {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cream);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.translate-btn button:hover {
  border-color: var(--sage-light);
  color: var(--sage-green);
}

.translate-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  min-width: 150px;
  z-index: 200;
  overflow: hidden;
}

.translate-menu.show {
  display: block;
}

.translate-menu a {
  display: block;
  padding: 0.65rem 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition);
  text-decoration: none;
}

.translate-menu a:hover {
  background: var(--cream);
  color: var(--sage-green);
}

.translate-menu a + a {
  border-top: 1px solid var(--border);
}

/* Pagefind Search */
#search-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

#search-modal.active {
  display: flex;
}

.search-modal-inner {
  background: var(--white);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 60vh;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.search-modal-header input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-family: inherit;
}

.search-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  line-height: 1;
}

.search-modal-close:hover {
  color: var(--text-primary);
}

#search-results {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  max-height: 45vh;
}

.pagefind-result {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.pagefind-result:last-child {
  border-bottom: none;
}

.pagefind-result h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.pagefind-result h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.pagefind-result h3 a:hover {
  color: var(--sage-green);
}

.pagefind-result p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.pagefind-result .pagefind-mark {
  background: rgba(139,168,136,0.25);
  padding: 0.1em 0.15em;
  border-radius: 2px;
}

.search-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .translate-btn {
    display: none;
  }
  .header-inner .header-right-mobile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}
