/* CloudCost - Cloud Pricing Comparison
   基础样式：深色主题 + 蓝色强调 + 响应式布局
   参考 pricing 站风格 */

:root {
  --bg: #0a0a1a;
  --bg-alt: #0f172a;
  --bg-card: #111827;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --border: #1f2937;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #0ea5e9;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 8px;
  --max-width: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "SF Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, monospace;
}

* { 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.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body.rtl { direction: rtl; }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary); text-decoration: underline; }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

.sr-only, .skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; top: 0; left: 0; width: auto; height: auto; padding: .5rem 1rem; background: var(--primary); color: #fff; z-index: 9999; clip: auto; }

/* ===== Header ===== */
.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1rem; max-width: var(--max-width); margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.logo img { width: 32px; height: 32px; }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; gap: 1.25rem; margin-left: 1rem; }
.main-nav a { color: var(--text-muted); font-size: .95rem; font-weight: 500; padding: .25rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.menu-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .25rem; }
.menu-bar { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: .2s; }

/* ===== Search box ===== */
.search-box { display: flex; gap: .5rem; }
.search-box input[type="search"] {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: .45rem .75rem; border-radius: var(--radius); font-size: .9rem; width: 200px; max-width: 40vw;
}
.search-box input[type="search"]:focus { outline: none; border-color: var(--primary); }
.search-box button {
  background: var(--primary); color: #fff; border: 0; padding: .45rem 1rem;
  border-radius: var(--radius); cursor: pointer; font-size: .9rem; font-weight: 500;
}
.search-box button:hover { background: var(--primary-hover); }

/* ===== Language switcher ===== */
.language-switcher { position: relative; }
.lang-trigger {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: .4rem .75rem; border-radius: var(--radius); cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; gap: .35rem;
}
.lang-trigger:hover { border-color: var(--primary); }
.lang-menu {
  position: absolute; right: 0; top: 100%; margin-top: .25rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  list-style: none; padding: .25rem; min-width: 140px; max-height: 320px; overflow-y: auto;
  display: none; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.lang-menu.open { display: block; }
.lang-menu li a { display: block; padding: .4rem .6rem; color: var(--text); font-size: .9rem; border-radius: 4px; }
.lang-menu li a:hover { background: var(--bg-alt); text-decoration: none; }
.lang-menu li a.active { color: var(--accent); font-weight: 600; }

/* ===== Main ===== */
main.container { padding: 2rem 1rem; min-height: 60vh; }

/* ===== Hero ===== */
.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero-title { font-size: 2.6rem; font-weight: 800; color: #fff; margin-bottom: .5rem; background: linear-gradient(135deg, var(--accent), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 720px; margin: 0 auto 1.5rem; }
.hero-search { max-width: 560px; margin: 0 auto 1rem; }
.hero-search .search-box input[type="search"] { width: 100%; max-width: none; padding: .75rem 1rem; font-size: 1rem; }
.hero-search .search-box { gap: .5rem; }
.hero-search .search-box button { padding: .75rem 1.5rem; font-size: 1rem; }
.hero-quick-links { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; align-items: center; margin-top: 1rem; font-size: .9rem; }
.quick-links-label { color: var(--text-muted); }
.hero-quick-links a { padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 20px; font-size: .85rem; }
.hero-quick-links a:hover { border-color: var(--primary); background: var(--bg-card); text-decoration: none; }
.hero-langs { margin-top: 1.5rem; }

/* ===== Home sections ===== */
.home-section { padding: 2rem 0; border-top: 1px solid var(--border); }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: #fff; }
.section-desc { color: var(--text-muted); margin-bottom: 1rem; }

/* ===== Provider / Compare / Guide grids ===== */
.provider-grid, .compare-grid, .guide-grid, .card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem;
}
.provider-card, .compare-card, .guide-card, .generic-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; transition: border-color .15s, transform .15s; display: block;
}
.provider-card:hover, .compare-card:hover, .guide-card:hover, .generic-card:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.provider-icon { font-size: 1.8rem; display: block; margin-bottom: .5rem; }
.provider-name { font-size: 1.15rem; font-weight: 700; color: #fff; display: block; }
.provider-desc { color: var(--text-muted); font-size: .85rem; }
.compare-card .compare-title, .guide-card .guide-title, .generic-card .card-title { color: #fff; font-size: 1.05rem; margin-bottom: .35rem; display: block; }
.compare-card .compare-desc, .guide-card .guide-desc, .generic-card .card-description { color: var(--text-muted); font-size: .9rem; }
.guide-date { color: var(--text-muted); font-size: .8rem; display: block; margin-top: .5rem; }
.home-section-footer { margin-top: 1rem; text-align: center; }

/* ===== Buttons ===== */
.btn { display: inline-block; padding: .6rem 1.25rem; border-radius: var(--radius); font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); text-decoration: none; }
.calculator-cta { text-align: center; }

/* ===== Single detail ===== */
.breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumb li::after { content: "/"; margin-left: .35rem; color: var(--border); }
.breadcrumb li:last-child::after { content: ""; }
.single-detail { max-width: 860px; margin: 0 auto; }
.single-header h1 { font-size: 2rem; color: #fff; margin-bottom: .5rem; }
.single-meta { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.meta-separator { color: var(--border); }
.single-content { font-size: 1rem; line-height: 1.75; }
.single-content h2 { font-size: 1.4rem; color: #fff; margin: 1.5rem 0 .5rem; }
.single-content h3 { font-size: 1.2rem; color: #fff; margin: 1.25rem 0 .5rem; }
.single-content p { margin-bottom: 1rem; }
.single-content ul, .single-content ol { margin: 0 0 1rem 1.5rem; }
.single-content li { margin-bottom: .35rem; }
.single-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.single-content th, .single-content td { border: 1px solid var(--border); padding: .6rem .75rem; text-align: left; }
.single-content th { background: var(--bg-alt); color: #fff; font-weight: 600; }
.single-content code { background: var(--bg-alt); padding: .15rem .35rem; border-radius: 4px; font-family: var(--mono); font-size: .9em; }
.single-content blockquote { border-left: 4px solid var(--primary); padding-left: 1rem; color: var(--text-muted); margin: 1rem 0; }
.single-tags { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.tags-inline { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.tag-pill { background: var(--bg-card); border: 1px solid var(--border); padding: .25rem .6rem; border-radius: 20px; font-size: .8rem; }
.single-languages { margin-top: 2rem; }
.single-languages h2 { font-size: 1.2rem; color: #fff; margin-bottom: .75rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.post-nav a { display: flex; flex-direction: column; color: var(--text); }
.post-nav-label { font-size: .8rem; color: var(--text-muted); }
.post-nav-title { font-size: .95rem; color: var(--accent); }
.post-nav-empty { flex: 1; }

/* ===== List page ===== */
.list-page { max-width: 960px; margin: 0 auto; }
.list-header h1 { font-size: 1.8rem; color: #fff; }
.list-description { color: var(--text-muted); margin: .5rem 0; }
.list-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: .9rem; color: var(--text-muted); }
.list-intro { margin-bottom: 1.5rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }

/* ===== 404 ===== */
.not-found-page { text-align: center; padding: 4rem 1rem; }
.not-found-code { font-size: 6rem; font-weight: 800; color: var(--primary); }
.not-found-title { font-size: 1.5rem; color: #fff; }
.not-found-desc { color: var(--text-muted); margin: .5rem 0 1.5rem; }
.not-found-actions { display: flex; gap: .75rem; justify-content: center; margin-bottom: 1.5rem; }
.not-found-search { max-width: 400px; margin: 0 auto; }

/* ===== Footer ===== */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 2.5rem 1rem 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr; gap: 2rem; max-width: var(--max-width); margin: 0 auto; }
.footer-col h4 { font-size: .95rem; color: #fff; margin-bottom: .75rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: var(--text-muted); font-size: .9rem; }
.footer-col a:hover { color: var(--accent); }
.footer-brand p { color: var(--text-muted); font-size: .85rem; margin-top: .5rem; }
.footer-langs { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; }
.footer-disclaimer { max-width: var(--max-width); margin: 1.5rem auto 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.footer-disclaimer p { color: var(--text-muted); font-size: .8rem; }
.footer-bottom { max-width: var(--max-width); margin: 1rem auto 0; text-align: center; }
.footer-bottom p { color: var(--text-muted); font-size: .85rem; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 1rem; gap: .75rem; }
  .main-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .header-actions { gap: .5rem; }
  .search-box input[type="search"] { width: 140px; }
  .hero-title { font-size: 1.8rem; }
  .hero-subtitle { font-size: .95rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .provider-grid, .compare-grid, .guide-grid, .card-grid { grid-template-columns: 1fr; }
  .post-nav { flex-direction: column; }
}

/* RTL support */
body.rtl .header-actions { margin-left: 0; margin-right: auto; }
body.rtl .main-nav { margin-left: 0; margin-right: 1rem; }
