/* ============================================
   TM Copy Paste — Stylesheet
   ============================================ */

/* --- CSS Variables (Light / Dark) --- */
:root,
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #3b82f6;
  --success: #22c55e;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.1);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e3a5f;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.4);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

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

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  text-decoration: none !important;
  color: var(--text);
}
.logo-t, .logo-m, .logo-cp { color: var(--primary); }
.logo-small { font-size: .75rem; color: var(--text-muted); }

.header-nav { display: flex; gap: .5rem; margin-left: auto; }
.nav-link {
  padding: .4rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .2s;
}
.nav-link:hover, .nav-link.active {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.theme-toggle {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .45rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background .2s;
}
.theme-toggle:hover { background: var(--border); }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 3.5rem 0 2.5rem;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%);
}

.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: .75rem;
  line-height: 1.25;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.symbol-grid-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 560px;
  margin: 0 auto;
}

.symbol-card-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
}
.symbol-card-big:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(37,99,235,.15);
  border-color: var(--primary);
}
.symbol-card-big.copied {
  border-color: var(--success);
  transform: scale(.95);
}

.symbol-char { font-size: 2.5rem; line-height: 1; }
.symbol-label { font-size: .8rem; font-weight: 600; color: var(--text); }
.copy-hint { font-size: .7rem; color: var(--text-muted); }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: #fff;
  padding: .6rem 1.4rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Sections --- */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }

.section h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .75rem;
}

.section p { margin-bottom: 1rem; color: var(--text); }
.section ul { margin: 0 0 1rem 1.5rem; }
.section li { margin-bottom: .35rem; }

.content-block {
  max-width: 850px;
}

.subtitle { color: var(--text-muted); font-size: 1rem; margin-top: .2rem; }

.tip {
  background: var(--primary-light);
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  font-size: .9rem;
  color: var(--text);
  margin-top: 1rem;
}

/* --- Symbol Detail --- */
.symbol-detail-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.symbol-card-inline {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s, border-color .2s;
  flex-shrink: 0;
}
.symbol-card-inline:hover { border-color: var(--primary); transform: scale(1.08); }
.symbol-card-inline.copied { border-color: var(--success); transform: scale(.94); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

/* --- Tables --- */
.table-responsive { overflow-x: auto; margin: 1.5rem 0; }

.code-table, .comparison-table, .shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.code-table th, .comparison-table th, .shortcuts-table th {
  background: var(--primary);
  color: #fff;
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 600;
}

.code-table td, .comparison-table td, .shortcuts-table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
}

.code-table tr:hover td,
.comparison-table tr:hover td,
.shortcuts-table tr:hover td {
  background: var(--surface-hover);
}

code {
  background: var(--surface-hover);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .85em;
}

kbd {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1rem .4rem;
  font-family: inherit;
  font-size: .82em;
  box-shadow: 0 1px 0 var(--border);
}

.btn-copy-sm {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .35rem .75rem;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
}
.btn-copy-sm:hover { background: var(--primary-hover); }
.btn-copy-sm.copied { background: var(--success); }

/* --- Use Cases Grid --- */
.use-case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.use-case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow .2s;
}
.use-case-card:hover { box-shadow: var(--shadow-lg); }
.use-case-icon { font-size: 2rem; margin-bottom: .75rem; }

.use-case-example {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem 1rem;
  font-family: 'Courier New', monospace;
  font-size: .85rem;
  margin-top: .75rem;
  color: var(--text-muted);
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.feature-card h3 { margin-bottom: .5rem; }

/* --- FAQ --- */
.faq-list { max-width: 800px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
  background: var(--surface);
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform .2s;
}
.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
}

/* --- CTA --- */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: #fff;
  text-align: center;
}
.cta-section h2 { color: #fff; }
.cta-section p { color: rgba(255,255,255,.85); max-width: 650px; margin: 0 auto 1.5rem; }

.btn-cta {
  display: inline-block;
  background: #fff;
  color: var(--primary);
  padding: .8rem 2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  text-decoration: none;
}

.text-center { text-align: center; }

/* --- Footer --- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 0;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(0, 2fr);
  align-items: start;
  gap: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.footer-col {
  flex: 1 1 0;
  min-width: 0;
}

.footer-desc {
  font-size: .9rem;
  color: var(--text-muted);
  margin-top: .75rem;
  max-width: 280px;
}

.footer-col h4 {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a {
  font-size: .9rem;
  color: var(--text);
  transition: color .2s;
}
.footer-col a:hover { color: var(--primary); text-decoration: none; }

.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .use-case-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 640px) {
  .symbol-grid-quick { grid-template-columns: repeat(2, 1fr); }
  .use-case-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links {
    display: grid;
    grid-template-columns: 1fr;
  }
  .header-nav { display: none; }
  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .mobile-menu-btn { display: flex; }
  .section { padding: 2.5rem 0; }
  .hero { padding: 2.5rem 0 2rem; }
}
