:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #334155;
    --radius: 8px;
    --layout-max-width: 1440px;
    --layout-padding-x: 24px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.site-main {
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
    align-self: stretch;
}

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

@media (min-width: 1024px) {
    :root {
        --layout-padding-x: 40px;
    }
}

.container {
    width: 100%;
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 0 var(--layout-padding-x);
}

.navbar,
.footer {
    width: 100%;
    flex-shrink: 0;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
}
.navbar-inner {
    max-width: var(--layout-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--layout-padding-x);
    display: flex;
    align-items: center;
    height: 56px;
    gap: 20px;
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-shrink: 0;
}
.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}
.navbar-brand span {
    color: var(--accent);
}
.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
    list-style: none;
    flex-shrink: 0;
}
.nav-links a {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-links a:hover {
    color: #ffffff;
}
.nav-links a.active {
    color: var(--accent);
}
.nav-search-form {
    width: 340px;
    flex-shrink: 0;
}
.nav-search-box {
    display: flex;
    align-items: center;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
    transition: border-color 0.2s, background-color 0.2s;
}
.nav-search-box:focus-within {
    border-color: rgba(59,130,246,0.5);
    background-color: rgba(255,255,255,0.08);
}
.nav-search-input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    color: #f1f5f9;
    font-size: 13px;
    outline: none;
    padding: 0 0 0 12px;
    min-width: 0;
}
.nav-search-input::placeholder {
    color: #64748b;
}
.nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 100%;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,0.08);
}
.nav-search-btn:hover {
    color: #94a3b8;
    background: rgba(255,255,255,0.05);
}
.nav-spacer {
    flex: 1;
    min-width: 16px;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 24px;
}
.nav-right-link {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-right-link:hover {
    color: #ffffff;
}

/* VIP button */
.nav-vip-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.nav-vip-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245,158,11,0.4);
    color: #fff;
}

/* Member badge (已开通) */
.nav-member-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    border: 1px solid transparent;
}
.nav-member-badge:hover {
    transform: translateY(-1px);
    color: #fff;
}
.nav-member-vip {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 2px 10px rgba(139,92,246,0.35);
}
.nav-member-vip:hover {
    box-shadow: 0 4px 16px rgba(139,92,246,0.5);
    color: #fff;
}
.nav-member-svip {
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 10px rgba(245,158,11,0.35);
}
.nav-member-svip:hover {
    box-shadow: 0 4px 16px rgba(245,158,11,0.5);
    color: #fff;
}
.nav-member-badge .member-icon {
    font-size: 11px;
    line-height: 1;
}
.nav-member-badge .member-expire {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.85;
    padding-left: 4px;
    border-left: 1px solid rgba(255,255,255,0.35);
    margin-left: 2px;
}

/* Wallet button */
.nav-wallet-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #e2e8f0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-wallet-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

.nav-sep {
    color: var(--text-muted);
    font-size: 12px;
}

/* User dropdown */
.nav-user-dropdown {
    position: relative;
}
.nav-user-trigger {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-user-trigger::after {
    content: '';
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #64748b;
    margin-left: 2px;
}
.nav-user-trigger:hover {
    background: rgba(255,255,255,0.08);
}
.nav-user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    padding: 6px 0;
    z-index: 200;
}
.nav-user-dropdown.open .nav-user-menu {
    display: block;
}
.nav-user-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.nav-user-menu a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-user-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.nav-user-logout {
    color: var(--danger) !important;
}

/* VIP badge */
.vip-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}
.vip-inactive {
    background: rgba(100,116,139,0.2);
    color: #64748b;
    border: 1px solid rgba(100,116,139,0.3);
}
.vip-active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: 1px solid #f59e0b;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: #16a34a;
    color: #fff;
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
    color: #fff;
}
.btn-warning {
    background: var(--warning);
    color: #000;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}
.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tr:hover {
    background: var(--bg-hover);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}
.badge-expired {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}
.badge-revoked {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}
.badge-pending {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}
.badge-paid {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}
.badge-cancelled {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}
.badge-awaiting_review {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Page layout */
.page-header {
    padding: 40px 0 24px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 700;
}
.page-header p {
    color: var(--text-secondary);
    margin-top: 4px;
}

.content-grid {
    display: grid;
    gap: 24px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px;
}
.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.stat-card-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Favorite tools grid */
.favorite-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.favorite-tool-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s;
}
.favorite-tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.favorite-tool-cover {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-hover);
}
.favorite-tool-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.favorite-tool-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-muted);
}
.favorite-tool-body { flex: 1; min-width: 0; }
.favorite-tool-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.favorite-tool-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.favorite-tool-cta {
    font-size: 13px;
    color: var(--accent);
    flex-shrink: 0;
}
.btn-favorite.is-favorited {
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.08);
}

/* Hero section */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}
.hero h1 {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
}
.hero h1 span {
    color: var(--accent);
}
.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero .btn {
    margin-top: 32px;
    padding: 14px 32px;
    font-size: 16px;
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 40px 0;
}
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}
.pricing-card.featured {
    border-color: var(--accent);
    position: relative;
}
.pricing-card.featured::before {
    content: "推荐";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.pricing-card .plan-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}
.pricing-card .plan-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
}
.pricing-card .plan-price span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}
.pricing-card .plan-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 16px 0 24px;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 60px 0;
}
.feature-item {
    text-align: center;
    padding: 32px 20px;
}
.feature-icon {
    font-size: 36px;
    margin-bottom: 16px;
}
.feature-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
}
.feature-item p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Sidebar layout for admin/user */
.layout-sidebar {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - 57px);
}
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 0;
}
.sidebar-menu {
    list-style: none;
}
.sidebar-menu a {
    display: block;
    padding: 10px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-right: 3px solid var(--accent);
}
.sidebar-menu a.active {
    color: var(--accent);
}
.sidebar-menu .sidebar-divider {
    height: 1px;
    margin: 12px 24px;
    background: var(--border);
    list-style: none;
}
.main-content {
    padding: 24px 32px;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 0;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    background: var(--bg-primary);
}
.footer-main {
    padding: 48px 0 36px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.35);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.footer-logo {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}
.footer-logo span {
    color: var(--accent);
}
.footer-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 280px;
}
.footer-col h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: 0.04em;
}
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a {
    color: var(--text-secondary);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--text-primary);
}
.footer-legal {
    padding: 28px 0;
}
.footer-legal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px 32px;
}
.footer-legal-item {
    font-size: 12px;
    line-height: 1.75;
    color: var(--text-muted);
}
.footer-legal-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.footer-bottom {
    padding: 20px 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}
.footer-bottom-note {
    color: var(--text-muted);
    opacity: 0.85;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-legal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --layout-padding-x: 16px;
    }
    html,
    body {
        overflow-x: hidden;
    }
    img,
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .layout-sidebar {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    /* 移动端侧栏横向菜单由 brand.css 处理；无侧栏菜单的页面不显示 aside */
    .layout-sidebar:not(:has(.sidebar-menu)) .sidebar {
        display: none;
    }
    .main-content {
        padding: 16px var(--layout-padding-x);
    }
    .hero h1 {
        font-size: 28px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .navbar {
        height: auto;
    }
    .navbar-inner {
        /* 详细移动端网格布局见 brand.css */
        height: auto;
    }
    .nav-left {
        flex: unset;
    }
    .nav-links {
        width: auto;
    }
    .nav-search-form {
        width: 100%;
    }
    .nav-spacer {
        display: none;
    }
    .nav-right {
        margin-left: 0;
        white-space: normal;
    }
    .nav-member-badge .member-expire {
        display: none;
    }
    .nav-user-menu {
        right: 0;
        left: auto;
        max-width: min(280px, calc(100vw - 32px));
    }
    .page-header {
        padding-top: 24px !important;
        padding-bottom: 8px !important;
    }
    .page-header h1 {
        font-size: 22px;
        line-height: 1.35;
        word-break: break-word;
    }
    .strategy-grid-home,
    .strategy-grid-home-main,
    .strategy-grid-home-curated,
    .strategy-grid-main,
    .strategy-grid-curated,
    .strategy-grid {
        grid-template-columns: 1fr !important;
    }
    .tools-grid {
        grid-template-columns: 1fr !important;
    }
    .detail-layout {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    .content-empty {
        padding: 48px 16px;
    }
    .support-qr-img {
        width: 140px;
        height: 140px;
    }
    .license-key-box {
        font-size: 13px;
        letter-spacing: 0.5px;
        word-break: break-all;
        padding: 12px;
    }
    .resource-list-item {
        padding: 14px 12px;
    }
    .filter-bar input[type="text"] {
        min-width: 0;
        width: 100%;
    }
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .nav-member-badge .member-text {
        max-width: 80px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth page */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 57px);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 22px;
}
.auth-card .auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* License key display */
.license-key-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 1px;
    text-align: center;
    user-select: all;
    cursor: pointer;
    transition: border-color 0.2s;
}
.license-key-box:hover {
    border-color: var(--accent);
}

/* Tag badges */
.tag-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.tag-low { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.tag-mid { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tag-high { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.tag-platform { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.tag-type { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

/* Filter bar */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.filter-bar form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--accent);
}
.filter-bar input[type="text"] {
    min-width: 200px;
}

/* Strategy library card */
.lib-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.lib-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.lib-card-img {
    aspect-ratio: 16/9;
    background: var(--bg-hover);
    overflow: hidden;
}
.lib-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.lib-card:hover .lib-card-img img {
    transform: scale(1.05);
}
.lib-card-body {
    padding: 16px;
}
.lib-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}
.lib-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}
.lib-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.lib-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}
.lib-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.lib-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.stat-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: 0.9;
}
.stat-icon-filled {
    opacity: 1;
}

/* Homepage / favorites strategy cards */
.strategy-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.strategy-home-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.strategy-home-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.strategy-home-card .cover-wrap {
    aspect-ratio: 16/9;
    background: var(--bg-hover);
    overflow: hidden;
    position: relative;
}
.strategy-home-card .cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.strategy-home-card:hover .cover-wrap img {
    transform: scale(1.05);
}
.strategy-home-card .cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 48px;
}
.strategy-home-card .card-body {
    padding: 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.strategy-home-card .card-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.strategy-home-card .card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.strategy-home-card .card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}
.strategy-home-card .card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.strategy-home-card .card-bottom .views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
.strategy-home-card .card-bottom .view-cta {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}

/* Resource list (vertical) */
.resource-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.resource-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.resource-list-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.resource-list-main {
    flex: 1;
    min-width: 0;
}
.resource-list-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.resource-list-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.resource-list-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.resource-list-date {
    font-size: 12px;
    color: var(--text-muted);
}
.resource-list-arrow {
    font-size: 18px;
    color: var(--accent);
    margin-left: 4px;
}
@media (max-width: 768px) {
    .resource-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .resource-list-meta { width: 100%; }
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* Sidebar filter layout */
.strategy-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px 0 48px;
    width: 100%;
    align-items: stretch;
}
@media (min-width: 769px) {
    .strategy-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .filter-sidebar {
        flex: 0 0 220px;
        width: 220px;
        max-width: 220px;
    }
    .strategy-main {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }
}
@media (max-width: 768px) {
    .filter-sidebar {
        position: static;
        width: 100%;
        max-width: none;
    }
    .content-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-search {
        width: 100%;
    }
    .toolbar-search-box {
        width: 100%;
    }
    .toolbar-search-input {
        min-width: 0;
    }
}
.filter-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}
.filter-sidebar .filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.filter-sidebar h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.filter-sidebar label {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}
.filter-sidebar label:hover {
    color: var(--text-primary);
}
.filter-sidebar input[type="radio"],
.filter-sidebar input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--accent);
}
.filter-sidebar .filter-active {
    color: var(--accent) !important;
    font-weight: 600;
}
.filter-sidebar .filter-clear {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
}
.filter-sidebar .filter-clear:hover {
    color: var(--accent);
}

.filter-support-section {
    text-align: center;
}
.filter-support-section h4 {
    text-align: left;
}
.support-qr-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}
.support-qr-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
}
.support-qr-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}
.support-qr-empty {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 12px 0;
}

/* Content toolbar (search + sort above content) */
.content-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.content-empty {
    text-align: center;
    padding: 80px 24px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 100%;
}
.content-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}
.content-empty-text {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 15px;
}
.toolbar-search {
    flex-shrink: 0;
}
.toolbar-search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    overflow: hidden;
    height: 36px;
    transition: border-color 0.2s;
}
.toolbar-search-box:focus-within {
    border-color: var(--accent);
}
.toolbar-search-input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    padding: 0 12px;
    min-width: 180px;
}
.toolbar-search-input::placeholder {
    color: var(--text-muted);
}
.toolbar-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 100%;
    border: none;
    border-left: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.toolbar-search-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.toolbar-sort {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.toolbar-sort-label {
    white-space: nowrap;
}
.toolbar-sort-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.toolbar-sort-select:focus {
    border-color: var(--accent);
}
.toolbar-sort-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.toolbar-sort-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.toolbar-sort-link:hover {
    color: var(--text-primary);
}
.toolbar-sort-link.active {
    color: var(--accent);
    background: rgba(59,130,246,0.1);
}

/* Tools page */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Strategy library sections */
.strategy-main {
    min-width: 0;
}
.strategy-section {
    margin-bottom: 40px;
}
.section-toolbar {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.section-toolbar-sort {
    justify-self: start;
}
.section-toolbar-title {
    justify-self: center;
    text-align: center;
    min-width: 0;
}
.section-toolbar-title h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}
.section-toolbar-title p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}
.section-toolbar-search {
    justify-self: end;
}
.strategy-section-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.strategy-section-curated {
    margin-bottom: 0;
}
.strategy-grid {
    display: grid;
    gap: 20px;
}
.strategy-grid-main {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.strategy-grid-curated {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.strategy-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.lib-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 40px;
}
.lib-card-more {
    color: var(--accent);
}
.strategy-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.strategy-empty .btn {
    margin-top: 12px;
}
.strategy-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: border-color 0.2s, color 0.2s;
}
.pagination-btn:hover:not(.disabled) {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}
@media (max-width: 1200px) {
    .strategy-grid-main {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .section-toolbar {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .section-toolbar-sort,
    .section-toolbar-search {
        justify-self: stretch;
    }
    .section-toolbar-search .toolbar-search-box {
        width: 100%;
    }
    .section-toolbar-search .toolbar-search-input {
        min-width: 0;
        width: 100%;
    }
    .strategy-grid-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .strategy-grid-main {
        grid-template-columns: 1fr;
    }
}
