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

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

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: #3498db; text-decoration: none; transition: color 0.2s; }
a:hover { color: #1a6ea0; text-decoration: underline; }

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

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, #2c3e50, #1a2a3a);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white !important;
  text-decoration: none !important;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; }

.logo-name {
  font-size: 1.1rem;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.logo-tagline {
  font-size: 0.65rem;
  opacity: 0.75;
  white-space: nowrap;
}

/* ===== Navigation ===== */
.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  color: rgba(255,255,255,0.8);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
  text-decoration: none !important;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,0.12);
  color: white;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.nav-toggle:hover { background: rgba(255,255,255,0.1); }

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: 30px 20px;
}

.page-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* ===== Page Hero (index.html) ===== */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.hero h1 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.05rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.hero .tool-count {
  display: inline-block;
  font-size: 0.85rem;
  color: #3498db;
  font-weight: bold;
  margin-bottom: 24px;
}

/* ===== Search Box ===== */
.search-box {
  max-width: 480px;
  margin: 0 auto 10px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid #e1e4e8;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}

.search-box input:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #999;
  pointer-events: none;
}

.search-box .search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  display: none;
  border-radius: 4px;
}

.search-box .search-clear:hover { background: #f0f2f5; }

.search-box .search-clear.visible { display: block; }

/* ===== Calculator Card Grid ===== */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 10px 0 40px;
}

.calc-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 28px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
}

.calc-card.hidden { display: none; }

/* ===== NEW Badge ===== */
.new-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: #ff6b6b;
  color: white;
  font-weight: bold;
  letter-spacing: 0.03em;
  animation: badgePulse 2s ease-in-out 3;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== Search No-Results ===== */
.search-noresult {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 0.95rem;
  display: none;
}

.search-noresult.visible { display: block; }

.calc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.calc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
}

.calc-card h2 {
  font-size: 1.15rem;
  color: #2c3e50;
  margin-bottom: 8px;
}

.calc-card p {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.calc-card .btn {
  align-self: flex-start;
  display: inline-block;
  padding: 8px 20px;
  background: #3498db;
  color: white;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  text-decoration: none !important;
  transition: background 0.2s;
}

.calc-card .btn:hover { background: #2176ae; }

/* ===== Footer ===== */
.site-footer {
  background: #2c3e50;
  color: rgba(255,255,255,0.7);
  padding: 30px 20px;
  margin-top: auto;
}

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

.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.footer-nav a {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  text-decoration: none !important;
  transition: color 0.2s;
}

.footer-nav a:hover { color: white; }

.copyright {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ===== Policy Pages ===== */
.policy-page {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.policy-page h1 {
  font-size: 1.6rem;
  color: #2c3e50;
  margin-bottom: 8px;
}

.policy-page .updated {
  color: #999;
  font-size: 0.85rem;
  margin-bottom: 30px;
}

.policy-page h2 {
  font-size: 1.15rem;
  color: #2c3e50;
  margin: 28px 0 12px;
}

.policy-page p, .policy-page li {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #555;
}

.policy-page ul { padding-left: 20px; }
.policy-page li { margin-bottom: 6px; }

/* ===== Utility ===== */
.text-center { text-align: center; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner { height: 56px; }

  .logo-tagline { display: none; }

  .site-nav { display: none; }
  .site-nav.open { display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: #1a2a3a; padding: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.2); }

  .nav-toggle { display: block; }

  .main-content { padding: 20px 16px; }

  .hero { padding: 40px 16px 30px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.95rem; }
  .search-box input { font-size: 0.9rem; padding: 10px 14px 10px 40px; }

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

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

  .policy-page { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.3rem; }
  .calc-card { padding: 20px 16px; }
}
