:root {
  --fox-orange: #f6851b;
  --fox-dark: #e2761b;
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-hover: #1c2128;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --accent: #f6851b;
  --accent-light: #ffa657;
  --danger: #f85149;
  --success: #3fb950;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

body[lang="ja"] { font-family: var(--font-ja), var(--font); }

a { color: var(--accent-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--fox-orange); text-decoration: underline; }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

/* Wallet Navigation Tabs */
.wallet-nav {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.wallet-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.wallet-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.wallet-tab.active {
  color: #fff;
  background: var(--fox-orange);
  box-shadow: 0 2px 8px rgba(246, 133, 27, 0.3);
}

.wallet-tab-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Trust Wallet tab accent color */
.wallet-tab[data-wallet="trust"].active {
  background: #3375BB;
  box-shadow: 0 2px 8px rgba(51, 117, 187, 0.3);
}

/* Content panels */
.wallet-panel {
  display: none;
}

.wallet-panel.active {
  display: block;
}

/* Trust Wallet Container */
.tw-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.tw-hero {
  padding: 3rem 0 2rem;
}

.tw-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(51, 117, 187, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(51, 117, 187, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.tw-hero h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, #58a6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tw-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
}

.tw-alert-inner {
  background: rgba(51, 117, 187, 0.08);
  border-color: rgba(51, 117, 187, 0.25);
}

.tw-alert-inner strong { color: #58a6ff; }

.tw-section-title::before {
  background: #3375BB;
}

.tw-tip-num {
  background: #3375BB !important;
}

/* MetaMask Email Section */
.mm-email-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
}

.mm-email-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mm-email-icon { font-size: 1.5rem; }

.mm-email-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.mm-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--fox-orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.mm-email-btn:hover { background: var(--fox-dark); }
.mm-email-btn:active { transform: scale(0.97); }
.mm-email-btn:disabled { opacity: 0.7; pointer-events: none; }

/* Trust Wallet Email Section */
.tw-email-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
}

.tw-email-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tw-email-icon { font-size: 1.5rem; }

.tw-email-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.tw-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #3375BB;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.tw-email-btn:hover { background: #2a5f9a; }
.tw-email-btn:active { transform: scale(0.97); }
.tw-email-btn:disabled { opacity: 0.7; pointer-events: none; }

.tw-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tw-spin 0.7s linear infinite;
}

@keyframes tw-spin { to { transform: rotate(360deg); } }

/* Trust Wallet TG promo - remove double padding since inside .main-content */
.tw-container .tg-promo {
  max-width: none;
  padding: 0 0 1rem;
}

/* Email Modal */
.email-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.email-modal-overlay.show {
  display: flex;
}

.email-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.email-modal h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.email-modal p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.email-modal input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1.25rem;
}

.email-modal input:focus {
  border-color: #3375BB;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.modal-actions button {
  padding: 0.65rem 1.5rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.modal-actions button:active { transform: scale(0.97); }

.btn-cancel {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border) !important;
}

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

.btn-submit {
  background: #3375BB;
  color: #fff;
}

.btn-submit:hover { background: #2a5f9a; }

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

.logo:hover { text-decoration: none; color: var(--text); }

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--fox-orange), var(--fox-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.logo-text h1 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Custom Language Dropdown */
.lang-wrapper {
  position: relative;
  z-index: 50;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
  white-space: nowrap;
}

.lang-toggle:hover { border-color: rgba(246, 133, 27, 0.4); }

.lang-globe { font-size: 0.95rem; }

.lang-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

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

.lang-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  min-width: 200px;
  max-height: 360px;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 200;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.lang-dropdown.open {
  display: grid;
}

.lang-dropdown .lang-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
  font-family: inherit;
}

.lang-dropdown .lang-btn:hover {
  background: rgba(246, 133, 27, 0.1);
  color: var(--text);
}

.lang-dropdown .lang-btn.active {
  background: var(--fox-orange);
  color: #000;
  font-weight: 700;
}

html[dir="rtl"] .lang-dropdown { right: auto; left: 0; }

html[dir="rtl"] .header-inner { flex-direction: row-reverse; }
html[dir="rtl"] .logo { flex-direction: row-reverse; }
html[dir="rtl"] .alert-inner { flex-direction: row-reverse; }
html[dir="rtl"] .section-title::before { margin-left: 0.5rem; margin-right: 0; }
html[dir="rtl"] .article-body ul,
html[dir="rtl"] .article-body ol { margin: 0.75rem 1.5rem 1rem 0; }
html[dir="rtl"] .article-body blockquote {
  border-left: none;
  border-right: 3px solid var(--fox-orange);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* Hero */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
}

/* Alert banner */
.alert-banner {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

.alert-inner {
  background: rgba(246, 133, 27, 0.08);
  border: 1px solid rgba(246, 133, 27, 0.25);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.alert-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; }
.alert-inner p { font-size: 0.9rem; color: var(--text-muted); }
.alert-inner strong { color: var(--accent-light); }

/* Main content */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 1.3rem;
  background: var(--fox-orange);
  border-radius: 2px;
}

/* News grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-3px);
  border-color: rgba(246, 133, 27, 0.4);
  box-shadow: var(--shadow);
}

.card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.tag-phishing { background: rgba(248, 81, 73, 0.15); color: var(--danger); }
.tag-scam { background: rgba(246, 133, 27, 0.15); color: var(--fox-orange); }
.tag-guide { background: rgba(63, 185, 80, 0.15); color: var(--success); }
.tag-alert { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }

.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.card-body p {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.read-more {
  color: var(--fox-orange);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.read-more:hover { color: var(--accent-light); text-decoration: none; }

/* Tips section */
.tips-section {
  margin-top: 3rem;
}

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

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.tip-num {
  width: 28px;
  height: 28px;
  background: var(--fox-orange);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.tip-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.tip-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Article page */
.article-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.back-link:hover { color: var(--fox-orange); text-decoration: none; }

.article-header .card-tag { margin-bottom: 0.75rem; }

.article-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--accent-light);
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.article-body p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.article-body ul, .article-body ol {
  margin: 0.75rem 0 1rem 1.5rem;
  color: var(--text-muted);
}

.article-body li { margin-bottom: 0.4rem; }

.article-body blockquote {
  border-left: 3px solid var(--fox-orange);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  background: rgba(246, 133, 27, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer p { margin-bottom: 0.4rem; }

/* Telegram promo */
.tg-promo {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

.tg-promo-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(36, 161, 222, 0.12), rgba(246, 133, 27, 0.08));
  border: 1px solid rgba(36, 161, 222, 0.35);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  position: relative;
}

.tg-promo-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: rgba(36, 161, 222, 0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #54a9eb;
}

.tg-promo-body { flex: 1; min-width: 0; }

.tg-promo-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.tg-promo-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.tg-promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: #24a1de;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.tg-promo-btn:hover { background: #1d8ec4; }
.tg-promo-btn:active { transform: scale(0.98); }

.tg-promo-handle { font-weight: 700; }

.tg-promo-hint {
  font-size: 0.78rem;
  opacity: 0.85;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.tg-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  box-shadow: var(--shadow);
}

.tg-toast.tg-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tg-toast.tg-toast-error {
  border-color: var(--danger);
  color: var(--danger);
}

html[dir="rtl"] .tg-promo-inner { flex-direction: row-reverse; }
html[dir="rtl"] .tg-promo-hint {
  padding-left: 0;
  padding-right: 0.65rem;
  border-left: none;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
}

/* Responsive */
@media (max-width: 600px) {
  .header-inner { padding: 0.85rem 1rem; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .main-content { padding: 0 1rem 3rem; }
  .news-grid { grid-template-columns: 1fr; }
  .tg-promo-inner { flex-direction: column; text-align: center; }
  .tg-promo-btn { width: 100%; justify-content: center; }
  .wallet-nav { order: 3; flex: 1; }
  .wallet-tab { flex: 1; justify-content: center; padding: 0.4rem 0.6rem; font-size: 0.78rem; }
  .header-inner { flex-wrap: wrap; }
  .lang-dropdown { grid-template-columns: repeat(3, 1fr); min-width: 180px; }
  .tw-email-section, .mm-email-section { flex-direction: column; align-items: stretch; text-align: center; }
  .tw-email-btn, .mm-email-btn { width: 100%; justify-content: center; }
  .tw-hero { padding: 2rem 0 1.5rem; }
  .tw-container { padding: 0 1rem; }
}
