/*
 Theme Name:   TopWisdom Blog
 Theme URI:    https://www.topwisdomhk.net/blog
 Description:  鼎智科技公司部落格子主題，基於 Astra 主題 — Dark Tech Theme
 Author:       鼎智科技 Top Wisdom Technology
 Author URI:   https://www.topwisdomhk.net
 Template:     astra
 Version:      1.1.0
 License:      GNU General Public License v2 or later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  topwisdom-blog
 Tags:         blog, chinese, hong-kong, saas, business, dark-theme
*/

/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
    --tw-blue: #1890FF;
    --tw-blue-dark: #1070d0;
    --tw-blue-light: rgba(24, 144, 255, 0.12);
    --tw-heading: #ffffff;
    --tw-text: #CBD7EB;
    --tw-orange: #F5A623;
    --tw-orange-hover: #e6971a;
    --tw-bg: #0d0d1a;
    --tw-white: #141425;
    --tw-border: rgba(255, 255, 255, 0.08);
    --tw-radius: 12px;
    --tw-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --tw-shadow-hover: 0 8px 30px rgba(24, 144, 255, 0.2);
    --tw-container: 1200px;
    --tw-font-cn: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Microsoft JhengHei', sans-serif;
    --tw-font-en: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   BASE TYPOGRAPHY & RESET
   ============================================ */
body {
    font-family: var(--tw-font-cn);
    color: var(--tw-text);
    background-color: var(--tw-bg);
    line-height: 1.8;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--tw-font-cn);
    color: var(--tw-heading);
    font-weight: 700;
    line-height: 1.4;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.375rem; }

a {
    color: var(--tw-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--tw-blue-dark);
}

.tw-container {
    max-width: var(--tw-container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   HEADER — NAV GLASS EFFECT
   ============================================ */
.tw-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(13, 13, 26, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--tw-border);
    transition: box-shadow 0.3s ease;
}
.tw-header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.tw-header-inner {
    max-width: var(--tw-container);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.tw-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--tw-heading);
    text-decoration: none;
}
.tw-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--tw-blue), var(--tw-blue-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.875rem;
    font-family: var(--tw-font-en);
}

/* ============================================
   NAVIGATION
   ============================================ */
.tw-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.tw-nav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 0.9375rem;
    color: var(--tw-text);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    text-decoration: none;
}
.tw-nav a:hover {
    background: var(--tw-blue-light);
    color: var(--tw-blue);
}
.tw-nav a.active {
    background: var(--tw-blue);
    color: #fff;
}
.tw-nav a.back-to-main {
    color: var(--tw-orange);
    font-weight: 600;
}
.tw-nav a.back-to-main:hover {
    background: rgba(245, 166, 35, 0.1);
    color: var(--tw-orange-hover);
}

/* Hamburger */
.tw-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}
.tw-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.tw-hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.tw-hamburger.open span:nth-child(2) {
    opacity: 0;
}
.tw-hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav overlay */
.tw-mobile-nav {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 13, 26, 0.98);
    backdrop-filter: blur(20px);
    z-index: 999;
    padding: 24px;
    flex-direction: column;
    gap: 4px;
}
.tw-mobile-nav.open {
    display: flex;
}
.tw-mobile-nav a {
    display: block;
    padding: 14px 20px;
    font-size: 1.0625rem;
    color: var(--tw-text);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}
.tw-mobile-nav a:hover,
.tw-mobile-nav a.active {
    background: var(--tw-blue-light);
    color: var(--tw-blue);
}

/* ============================================
   PAGE HERO / SECTION HEADER
   ============================================ */
.tw-page-hero {
    background: linear-gradient(135deg, #0a0a18 0%, var(--tw-blue-dark) 100%);
    color: #fff;
    padding: 60px 0 50px;
    margin-bottom: 48px;
}
.tw-page-hero h1 {
    color: #fff;
    font-size: 2.25rem;
    margin-bottom: 8px;
}
.tw-page-hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.0625rem;
    margin: 0;
}

/* ============================================
   BLOG CARD GRID
   ============================================ */
.tw-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    margin-bottom: 48px;
}

.tw-post-card {
    background: var(--tw-white);
    border-radius: var(--tw-radius);
    overflow: hidden;
    box-shadow: var(--tw-shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.tw-post-card:hover {
    box-shadow: var(--tw-shadow-hover);
    transform: translateY(-4px);
}

.tw-post-card .card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--tw-blue-light);
}
.tw-post-card .card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, rgba(24, 144, 255, 0.08) 0%, rgba(13, 13, 26, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tw-blue);
    font-size: 2rem;
}

.tw-post-card .card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.tw-post-card .card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--tw-blue);
    background: var(--tw-blue-light);
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.tw-post-card .card-title {
    font-size: 1.1875rem;
    color: var(--tw-heading);
    margin: 0 0 12px;
    line-height: 1.5;
    font-weight: 700;
}
.tw-post-card .card-title a {
    color: inherit;
    text-decoration: none;
}
.tw-post-card .card-title a:hover {
    color: var(--tw-blue);
}
.tw-post-card .card-excerpt {
    font-size: 0.9375rem;
    color: var(--tw-text);
    line-height: 1.7;
    margin: 0 0 16px;
    flex: 1;
}
.tw-post-card .card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8125rem;
    color: #6b7280;
    padding-top: 16px;
    border-top: 1px solid var(--tw-border);
}

/* ============================================
   SINGLE POST
   ============================================ */
.tw-single-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    max-width: var(--tw-container);
    margin: 0 auto;
    padding: 48px 24px;
}

.tw-single-main {}

.tw-single-header {
    margin-bottom: 32px;
}
.tw-single-header .post-category {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tw-blue);
    background: var(--tw-blue-light);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 16px;
}
.tw-single-header h1 {
    font-size: 2rem;
    line-height: 1.45;
    margin: 0 0 16px;
}
.tw-single-header .post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.875rem;
    color: #6b7280;
}

.tw-single-content {
    font-size: 1.0625rem;
    line-height: 2;
    color: var(--tw-text);
}
.tw-single-content p {
    margin-bottom: 1.5em;
}
.tw-single-content h2 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--tw-blue-light);
}
.tw-single-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.tw-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--tw-radius);
    margin: 1.5em 0;
}
.tw-single-content blockquote {
    border-left: 4px solid var(--tw-blue);
    margin: 1.5em 0;
    padding: 16px 24px;
    background: rgba(24, 144, 255, 0.08);
    border-radius: 0 var(--tw-radius) var(--tw-radius) 0;
    color: var(--tw-heading);
    font-style: normal;
}
.tw-single-content ul, .tw-single-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}
.tw-single-content li {
    margin-bottom: 0.5em;
}
.tw-single-content pre {
    background: #1a1a2e;
    color: #e2e8f0;
    padding: 24px;
    border-radius: var(--tw-radius);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 1.5em 0;
}

.tw-post-nav {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--tw-border);
}
.tw-post-nav a {
    flex: 1;
    padding: 20px;
    background: var(--tw-white);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--tw-heading);
    transition: all 0.2s ease;
}
.tw-post-nav a:hover {
    border-color: var(--tw-blue);
    box-shadow: var(--tw-shadow);
}
.tw-post-nav a .nav-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 400;
}

/* ============================================
   SIDEBAR
   ============================================ */
.tw-sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.tw-sidebar-widget {
    background: #141425;
    border-radius: var(--tw-radius);
    padding: 24px;
    box-shadow: var(--tw-shadow);
}
.tw-sidebar-widget h3 {
    font-size: 1rem;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tw-blue-light);
    color: var(--tw-heading);
}
.tw-sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tw-sidebar-widget ul li {
    margin-bottom: 0;
}
.tw-sidebar-widget ul li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 0.9375rem;
    color: var(--tw-text);
    border-radius: 8px;
    transition: all 0.2s ease;
}
.tw-sidebar-widget ul li a:hover {
    background: var(--tw-blue-light);
    color: var(--tw-blue);
}
.tw-sidebar-widget ul li a .count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 100px;
    color: #6b7280;
}

.tw-sidebar-cta {
    background: linear-gradient(135deg, var(--tw-blue), var(--tw-blue-dark));
    color: #fff;
    border-radius: var(--tw-radius);
    padding: 28px 24px;
    text-align: center;
}
.tw-sidebar-cta h3 {
    color: #fff;
    border: none;
    padding: 0;
    margin-bottom: 8px;
    font-size: 1.125rem;
}
.tw-sidebar-cta p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 16px;
    line-height: 1.6;
}
.tw-sidebar-cta a {
    display: inline-block;
    background: var(--tw-orange);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background 0.2s ease;
}
.tw-sidebar-cta a:hover {
    background: var(--tw-orange-hover);
    color: #fff;
}

/* ============================================
   PAGINATION
   ============================================ */
.tw-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0 60px;
}
.tw-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--tw-white);
    color: var(--tw-text);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--tw-shadow);
    transition: all 0.2s ease;
}
.tw-pagination .page-numbers.current,
.tw-pagination .page-numbers:hover {
    background: var(--tw-blue);
    color: #fff;
}

/* ============================================
   FOOTER
   ============================================ */
.tw-footer {
    background: #080812;
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 0 0;
}
.tw-footer-inner {
    max-width: var(--tw-container);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
}
.tw-footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin: 0 0 16px;
    font-weight: 600;
}
.tw-footer-col p {
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 8px;
}
.tw-footer-col a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    display: block;
    padding: 4px 0;
    transition: color 0.2s ease;
}
.tw-footer-col a:hover {
    color: var(--tw-orange);
}
.tw-footer-col .company-desc {
    font-size: 0.875rem;
    line-height: 1.8;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.6);
}

.tw-footer-bottom {
    max-width: var(--tw-container);
    margin: 48px auto 0;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
}

/* ============================================
   WHATSAPP FLOATING BUTTON
   ============================================ */
.tw-whatsapp-float {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 998;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}
.tw-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}
.tw-whatsapp-float svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.tw-page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px;
}
.tw-page-content h1 {
    margin-bottom: 32px;
}
.tw-page-content p {
    margin-bottom: 1.5em;
    line-height: 2;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .tw-single-wrap {
        grid-template-columns: 1fr;
    }
    .tw-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .tw-nav {
        display: none;
    }
    .tw-hamburger {
        display: flex;
    }
    .tw-posts-grid {
        grid-template-columns: 1fr;
    }
    .tw-page-hero h1 {
        font-size: 1.625rem;
    }
    .tw-page-hero {
        padding: 40px 0 36px;
    }
    .tw-footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .tw-footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .tw-post-nav {
        flex-direction: column;
    }
    h1 { font-size: 1.625rem; }
    h2 { font-size: 1.375rem; }
}

@media (max-width: 480px) {
    .tw-header-inner {
        padding: 0 16px;
    }
    .tw-post-card .card-body {
        padding: 18px;
    }
    .tw-whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}
