/* ========================================
   SilverPrice.hk — Stylesheet
   ======================================== */

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

:root {
    --silver-50: #f8f9fa;
    --silver-100: #f1f3f5;
    --silver-200: #e9ecef;
    --silver-300: #dee2e6;
    --silver-400: #ced4da;
    --silver-500: #adb5bd;
    --silver-600: #868e96;
    --silver-700: #495057;
    --silver-800: #343a40;
    --silver-900: #212529;

    --accent: #4a90d9;
    --accent-light: #6ba3e0;
    --accent-dark: #2d6cb5;

    --green: #2ecc71;
    --green-bg: #e8f8ef;
    --red: #e74c3c;
    --red-bg: #fdecea;

    --bg: #ffffff;
    --bg-alt: #f8f9fb;
    --text: #1a1a2e;
    --text-secondary: #6c757d;
    --border: #e2e8f0;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", "PingFang HK", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

    --container: 1140px;
    --header-height: 64px;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

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

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

.logo-icon {
    color: var(--silver-500);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-hk {
    color: var(--accent);
}

.nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--silver-100);
}

.nav-link-active {
    color: var(--accent);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* --- Breadcrumb --- */
.breadcrumb {
    padding: 12px 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

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

/* --- Contextual Intro --- */
.intro-section {
    padding: 32px 0 0;
    background: var(--bg-alt);
}

.intro-content {
    max-width: 860px;
}

.intro-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 12px;
}

.intro-content p:last-child {
    margin-bottom: 0;
}

/* --- Hero / Price Section --- */
.hero {
    padding: 36px 0 32px;
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}

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

.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 32px;
}

.price-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 820px;
    margin: 0 auto;
}

.price-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.price-card:hover {
    box-shadow: var(--shadow-md);
}

.price-card-main {
    border-color: var(--accent);
    border-width: 2px;
}

.price-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.price-value {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.price-unit {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.price-change {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.price-change.up {
    color: var(--green);
    background: var(--green-bg);
}

.price-change.down {
    color: var(--red);
    background: var(--red-bg);
}

.price-meta {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Stats --- */
.stats {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 12px 8px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* --- Chart Section --- */
.chart-section {
    padding: 48px 0;
}

.chart-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.chart-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chart-btn {
    padding: 8px 18px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.chart-btn:hover {
    border-color: var(--accent-light);
    color: var(--accent);
}

.chart-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.chart-info {
    text-align: center;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Converter --- */
.converter-section {
    padding: 48px 0;
    background: var(--bg-alt);
}

.converter-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.converter {
    max-width: 700px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.converter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.converter-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.converter-field input,
.converter-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s;
}

.converter-field input:focus,
.converter-field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.converter-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.converter-result-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.converter-result-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent-dark);
}

/* --- History Table --- */
.history-section {
    padding: 48px 0;
}

.history-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.price-table thead {
    background: var(--silver-100);
}

.price-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.price-table td {
    padding: 11px 16px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    white-space: nowrap;
}

.price-table tbody tr:hover {
    background: var(--silver-50);
}

.price-table .change-up {
    color: var(--green);
    font-weight: 600;
}

.price-table .change-down {
    color: var(--red);
    font-weight: 600;
}

.loading-row {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px 16px !important;
    font-family: var(--font-sans) !important;
}

/* --- Info Section --- */
.info-section {
    padding: 48px 0;
    background: var(--bg-alt);
}

.info-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.info-card:hover {
    box-shadow: var(--shadow-md);
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin: 10px 0;
}

.info-table th,
.info-table td {
    padding: 6px 10px;
    border: 1px solid var(--border);
    text-align: left;
}

.info-table th {
    background: var(--silver-100);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.info-table td {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
}

/* --- FAQ Section --- */
.faq-section {
    padding: 48px 0;
}

.faq-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.guide-block {
    margin-bottom: 32px;
    max-width: 860px;
}

.guide-block h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.guide-block p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.faq-list {
    max-width: 860px;
}

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

.faq-item summary {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    background: var(--silver-50);
}

.faq-item p {
    padding: 0 20px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* --- Latest Articles --- */
.latest-articles {
    padding: 48px 0;
    background: var(--bg-alt);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.view-all-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.view-all-link:hover {
    color: var(--accent-dark);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.article-card {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text);
}

.article-card-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

.article-card h3 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.article-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- SEO Section --- */
.seo-section {
    padding: 48px 0;
    border-top: 1px solid var(--border);
}

.seo-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.seo-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 12px;
}

.seo-content p:last-child {
    margin-bottom: 0;
}

/* --- Footer --- */
.footer {
    background: var(--silver-900);
    color: var(--silver-400);
    padding: 48px 0 24px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 2fr;
    gap: 32px;
    margin-bottom: 32px;
}

.logo-footer .logo-icon {
    color: var(--silver-500);
}

.logo-footer .logo-text {
    color: var(--silver-200);
}

.footer-desc {
    margin-top: 10px;
    font-size: 0.85rem;
}

.footer-links h4,
.footer-disclaimer h4 {
    color: var(--silver-200);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    color: var(--silver-400);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 3px 0;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--silver-200);
}

.footer-disclaimer p {
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--silver-500);
}

.footer-bottom {
    border-top: 1px solid var(--silver-800);
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
}

.footer-bottom a {
    color: var(--silver-500);
}

.footer-bottom a:hover {
    color: var(--silver-300);
}

/* ========================================
   Blog Styles
   ======================================== */

/* --- Blog Index --- */
.blog-hero {
    padding: 40px 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.blog-hero h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.blog-hero p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.blog-list {
    padding: 40px 0;
}

.blog-list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.blog-card {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.blog-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text);
}

.blog-card-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-bottom: 10px;
}

.blog-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
}

.blog-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Blog Post / Article --- */
.blog-post {
    padding: 40px 0 60px;
}

.article-content {
    max-width: 780px;
}

.article-header {
    margin-bottom: 32px;
}

.article-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.article-category {
    background: var(--silver-100);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.article-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 32px 0 14px;
}

.article-content p {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
    margin: 0 0 16px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.9;
}

.article-content li {
    margin-bottom: 6px;
}

.article-content strong {
    color: var(--text);
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover {
    color: var(--accent-dark);
}

/* --- Static Pages (About, Contact, Privacy, Terms) --- */
.page-content {
    padding: 40px 0 60px;
}

.page-content h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.page-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 28px 0 12px;
}

.page-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 14px;
    max-width: 780px;
}

.page-content ul {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0 0 14px 20px;
    max-width: 780px;
}

.page-content li {
    margin-bottom: 4px;
}

.contact-info {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    max-width: 500px;
    margin-top: 20px;
}

.contact-info p {
    margin-bottom: 8px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px 20px;
        box-shadow: var(--shadow-md);
        z-index: 99;
    }

    .nav.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .price-cards {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .price-card {
        padding: 20px 16px;
    }

    .price-value {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-item {
        padding: 8px 4px;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .chart-wrapper {
        height: 280px;
        padding: 10px;
    }

    .converter-row {
        grid-template-columns: 1fr;
    }

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

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

    .blog-list-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .price-meta {
        flex-direction: column;
        gap: 4px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .article-header h1 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-controls {
        justify-content: center;
    }

    .chart-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* --- Loading / Skeleton Animation --- */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--silver-100) 25%, var(--silver-200) 50%, var(--silver-100) 75%);
    background-size: 400px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
