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

:root {
    /* Spacing (8px system) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    
    /* Typography */
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    
    /* Radius */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Layout */
    --max-width: 1280px;
    --header-height: 64px;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== Header ========== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    flex-shrink: 0;
}

.logo__icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.logo__text {
    font-size: var(--text-xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========== Navigation ========== */
.nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    padding: var(--space-2) 0;
}

.nav::-webkit-scrollbar { display: none; }

.nav__btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    min-height: 40px;
}

.nav__btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav__btn.active {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.15);
}

/* ========== Theme Toggle Button ========== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.theme-toggle:active {
    transform: translateY(0);
}

/* ========== Menu Toggle Button ========== */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.menu-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

/* ========== Theme Selector (Dropdown) ========== */

.theme-selector__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.theme-selector.open .theme-selector__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.theme-option:hover {
    background: var(--bg-tertiary);
}

.theme-option.active {
    background: var(--accent-color);
    color: white;
}

.theme-option__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.theme-option__name {
    font-size: 14px;
}

/* ========== Main ========== */
.main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
    width: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.section-title {
    font-size: var(--text-2xl);
    font-weight: 700;
}

/* ========== Search ========== */
.search-box {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-2) var(--space-3);
    min-width: 200px;
}

.search-box__input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: var(--text-sm);
    outline: none;
}

.search-box__input::placeholder { color: var(--text-muted); }

/* ========== Grid ========== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-5);
}

/* ========== Post Card (BEM) ========== */
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.post-card:hover {
    border-color: var(--primary);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.post-card__badge {
    display: inline-flex;
    padding: var(--space-1) var(--space-2);
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-card__badge--accent {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

.post-card__title {
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.post-card__excerpt {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__footer {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 兼容旧类名 */
.card { composes: post-card; }
.card-meta { composes: post-card__meta; }
.card-badge { composes: post-card__badge; }
.card-title { composes: post-card__title; }
.card-excerpt { composes: post-card__excerpt; }
.card-footer { composes: post-card__footer; }

/* ========== Modal (BEM + dialog) ========== */
.modal {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    z-index: 200;
    overflow-y: auto;
    padding: var(--space-4);
    border: none;
    max-width: 100vw;
    max-height: 100vh;
}

.modal::backdrop {
    background: var(--modal-overlay);
}

.modal[open] {
    display: flex;
}

.modal__content {
    background: var(--modal-bg);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    margin: auto;
    position: relative;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal__content--iframe {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal__header {
    position: sticky;
    top: 0;
    background: var(--modal-bg);
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.modal__header--sticky {
    position: sticky;
    top: 0;
    background: var(--modal-bg);
    z-index: 10;
}

.modal__title {
    font-size: var(--text-2xl);
    padding-right: 3rem;
    color: var(--text-primary);
}

.modal__info {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-2);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.modal__tool-title {
    font-size: var(--text-xl);
    color: var(--text-primary);
}

.modal__close-btn {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: var(--text-xl);
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal__close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.modal__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal__close:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.modal__body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

.modal__loading {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

.modal__error {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: #e74c3c;
    font-size: var(--text-lg);
}

/* Modal内工具样式优化 */
.modal__body .tool-wrapper {
    max-width: 100%;
    margin: 0;
}

.modal__body .tool-section-title {
    display: none; /* 在modal中隐藏，header已有标题 */
}

.modal__body .tool-input-group label {
    color: var(--text-primary);
    font-weight: 500;
}

.modal__body .tool-input-group input,
.modal__body .tool-input-group select,
.modal__body .tool-input-group textarea {
    width: 100%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: var(--space-3);
    border-radius: var(--radius);
}

.modal__body .tool-btn-primary,
.modal__body .tool-btn-secondary {
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius);
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal__body .tool-btn-primary {
    background: var(--primary);
    color: white;
}

.modal__body .tool-btn-primary:hover {
    background: var(--primary-dark);
}

.modal__body .tool-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal__body .tool-btn-secondary:hover {
    background: var(--bg-secondary);
}

.modal__body .tool-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.modal__body .tool-actions > button {
    flex: 1;
}

.modal__actions {
    text-align: center;
    margin-top: var(--space-6);
}

.modal__iframe {
    flex: 1;
    border: none;
    background: #fff;
    min-height: 600px;
    width: 100%;
}

/* Tool Modal iframe */
#toolFrame {
    width: 100%;
    min-height: calc(100vh - 150px);
    background: #fff;
}

/* ========== Article Content ========== */
.article-content {
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--text-primary);
}

.article-content h2 {
    font-size: var(--text-2xl);
    margin: var(--space-6) 0 var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.article-content h3 {
    font-size: var(--text-xl);
    margin: var(--space-5) 0 var(--space-3);
    color: var(--text-primary);
}

.article-content p { 
    margin: var(--space-4) 0; 
    color: var(--text-primary);
}

.article-content pre {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin: var(--space-4) 0;
    overflow-x: auto;
    font-size: var(--text-sm);
    border: 1px solid var(--border-color);
}

.article-content code {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: var(--bg-tertiary);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    color: var(--code-text);
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* ========== Code Block ========== */
.code-block {
    margin: var(--space-4) 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border-color);
}

.code-lang {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn:hover { background: var(--primary-dark); }

/* ========== Button (BEM) ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.btn--primary {
    background: var(--primary);
    color: white;
}

.btn--primary:hover { background: var(--primary-dark); }

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn--secondary:hover { 
    background: var(--bg-secondary);
    border-color: var(--primary);
}

/* 兼容旧类名 */
.btn-primary { composes: btn--primary; }

/* ========== Footer (BEM) ========== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--space-4);
    margin-top: auto;
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.footer__stats {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.footer__time {
    color: var(--text-muted);
}

.footer__copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
    padding-top: var(--space-2);
    width: 100%;
    order: 3; /* 放在最后 */
}

/* 兼容旧类名 */
.footer-inner { composes: footer__inner; }
.footer-stats { composes: footer__stats; }

/* ========== Category Grid (BEM) ========== */
.tools-container, .links-container {
    display: none;
    padding: var(--space-4) 0;
}

.tools-view {
    display: none;
    padding: var(--space-4) 0;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
}

.tool-category, .link-category {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.category {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.category__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--border-color);
}

.category__items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
}

/* 兼容旧类名 */
.category-title { composes: category__title; }
.tool-items, .link-items { composes: category__items; }

/* ========== Tool & Link Buttons ========== */
.tool-btn, .link-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all 0.15s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tool-btn:hover, .link-item:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
}

/* ========== Tool Category Section ========== */
.tool-category-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.tool-category-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--border-color);
}

.tool-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

/* ========== Tool Card ========== */
.tool-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-4);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    -webkit-tap-highlight-color: transparent;
}

.tool-card:hover {
    border-color: var(--primary);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tool-card__icon {
    font-size: 2rem;
}

.tool-card__title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.tool-card__desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ========== Tool Content Container ========== */
.tool-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--border-color);
}

.tool-back-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.tool-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.tool-title {
    font-size: var(--text-xl);
    font-weight: 600;
    flex: 1;
    color: var(--text-primary);
    margin: 0;
}

.tool-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    min-height: 400px;
}

.tool-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-muted);
    font-size: var(--text-lg);
}

.tool-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: var(--space-4);
    color: var(--text-muted);
}

.tool-error p {
    font-size: var(--text-lg);
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
    flex-wrap: nowrap;  /* 不换行 */
    overflow-x: auto;  /* 超出时横向滚动 */
    max-width: 100%;
    padding: var(--space-2);
}

.pagination::-webkit-scrollbar {
    height: 4px;
}

.pagination::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.page-btn {
    padding: var(--space-2) var(--space-3);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;  /* 文字不换行 */
    min-width: 40px;  /* 最小宽度 */
    text-align: center;
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-prev,
.page-next {
    min-width: 60px;
}

.page-ellipsis {
    color: var(--text-secondary);
    padding: 0 var(--space-1);
}

.page-info {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-left: var(--space-3);
    white-space: nowrap;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .pagination {
        gap: var(--space-1);
    }
    
    .page-btn {
        padding: var(--space-1) var(--space-2);
        font-size: 0.75rem;
        min-width: 32px;
    }
    
    .page-prev,
    .page-next {
        min-width: 50px;
    }
    
    .page-info {
        font-size: 0.75rem;
        margin-left: var(--space-2);
    }
}

/* ========== Link Card ========== */
/* 链接分类样式 */
.links-category {
    margin-bottom: var(--space-6);
}

.links-category__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-color);
}

.links-category__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-3);
}

.link-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.link-card:hover {
    border-color: var(--primary);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.link-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.link-card__content {
    flex: 1;
    min-width: 0;
}

.link-card__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.link-card__desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-muted);
    font-size: var(--text-lg);
}

.error {
    text-align: center;
    padding: var(--space-8);
    color: #ef4444;
    font-size: var(--text-lg);
}

.loading {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-muted);
    font-size: var(--text-lg);
}

/* ========== Announcement Bar ========== */
.announcement-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-3) var(--space-4);
}

.announcement {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
}

.announcement__icon {
    font-size: 1.25rem;
}

.announcement__text {
    flex: 1;
    color: var(--text-primary);
}

.announcement__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--text-lg);
    padding: var(--space-1);
}

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

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .header__inner {
        flex-wrap: wrap;
        height: auto;
        padding-top: var(--space-2);
        padding-bottom: var(--space-2);
    }
    
    .menu-toggle {
        display: flex;
        order: 1;
    }
    
    .theme-toggle {
        order: 2;
    }
    
    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        order: 3;
        padding: var(--space-3) 0;
    }
    
    .nav.open {
        display: flex;
    }
    
    .nav__btn {
        width: 100%;
        justify-content: flex-start;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .modal__content {
        margin: var(--space-2);
        max-height: calc(100vh - 1rem);
    }
    
    .modal__title {
        font-size: var(--text-xl);
    }
    
    .footer__inner {
        flex-direction: column;
        text-align: center;
    }
    
    .footer__stats {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========== Utility Classes ========== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }

/* ==================== 点击特效 ==================== */

.click-effect {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    animation: click-burst 0.6s ease-out forwards;
}

.center-effect {
    animation: center-burst 0.5s ease-out forwards;
}

@keyframes click-burst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

@keyframes center-burst {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
}

/* 表情特效 */
.effect-emoji {
    font-size: 24px;
    animation: emoji-pop 0.6s ease-out forwards;
}

@keyframes emoji-pop {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg) translateY(-30px);
        opacity: 0;
    }
}

/* 阳光特效 */
.effect-sun {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ffa500;
    animation: sun-glow 0.7s ease-out forwards;
}

@keyframes sun-glow {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
        text-shadow: 0 0 20px #ffd700, 0 0 40px #ffa500;
    }
    100% {
        transform: scale(0) translateY(-40px);
        opacity: 0;
    }
}

.center-sun {
    font-size: 36px;
    animation: center-sun-glow 0.5s ease-out forwards;
    text-shadow: 0 0 30px #ffd700;
}

@keyframes center-sun-glow {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 星星特效 */
.effect-star {
    color: #fff;
    text-shadow: 0 0 10px #fff, 0 0 20px #87ceeb, 0 0 30px #87ceeb;
    animation: star-twinkle 0.7s ease-out forwards;
}

@keyframes star-twinkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.4) rotate(180deg);
        opacity: 1;
        text-shadow: 0 0 20px #fff, 0 0 40px #87ceeb;
    }
    100% {
        transform: scale(0) rotate(360deg) translateY(-50px);
        opacity: 0;
    }
}

.center-star {
    font-size: 40px;
    animation: center-star-burst 0.5s ease-out forwards;
    text-shadow: 0 0 30px #ffd700, 0 0 60px #ffd700;
}

@keyframes center-star-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 爱心特效 */
.effect-heart {
    font-size: 28px;
    animation: heart-beat 0.7s ease-out forwards;
}

@keyframes heart-beat {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(0.9);
        opacity: 1;
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(0) translateY(-30px);
        opacity: 0;
    }
}

.center-heart {
    font-size: 44px;
    animation: center-heart-burst 0.5s ease-out forwards;
    text-shadow: 0 0 20px #ff69b4;
}

@keyframes center-heart-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    60% { transform: translate(-50%, -50%) scale(0.9); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 代码特效 */
.effect-code {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: bold;
    color: #10b981;
    text-shadow: 0 0 10px #10b981, 0 0 20px #10b981;
    animation: code-fall 0.7s ease-out forwards;
}

@keyframes code-fall {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) translateY(-40px) rotate(10deg);
        opacity: 0;
    }
}

.center-code {
    font-family: 'Courier New', monospace;
    font-size: 28px;
    font-weight: bold;
    color: #10b981;
    text-shadow: 0 0 20px #10b981, 0 0 40px #10b981;
    animation: center-code-flash 0.5s ease-out forwards;
}

@keyframes center-code-flash {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; text-shadow: 0 0 30px #10b981, 0 0 60px #10b981; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 樱花特效 */
.effect-sakura {
    font-size: 26px;
    animation: sakura-fall 0.8s ease-out forwards;
}

@keyframes sakura-fall {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg) translateY(40px);
        opacity: 0;
    }
}

.center-sakura {
    font-size: 42px;
    animation: center-sakura-burst 0.6s ease-out forwards;
    text-shadow: 0 0 20px #ffb6c1;
}

@keyframes center-sakura-burst {
    0% { transform: translate(-50%, -50%) scale(0.5) rotate(0deg); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.4) rotate(180deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0) rotate(360deg); opacity: 0; }
}

/* 叶子特效 */
.effect-leaf {
    font-size: 24px;
    animation: leaf-drift 0.8s ease-out forwards;
}

@keyframes leaf-drift {
    0% {
        transform: scale(0) rotate(0deg) translateX(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(180deg) translateX(10px);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg) translateX(20px) translateY(30px);
        opacity: 0;
    }
}

.center-leaf {
    font-size: 40px;
    animation: center-leaf-burst 0.5s ease-out forwards;
    text-shadow: 0 0 15px #228b22;
}

@keyframes center-leaf-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 气泡特效 */
.effect-bubble {
    font-size: 32px;
    color: rgba(59, 130, 246, 0.7);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    animation: bubble-rise 0.7s ease-out forwards;
}

@keyframes bubble-rise {
    0% {
        transform: scale(0) translateY(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) translateY(-20px);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.5) translateY(-50px);
        opacity: 0;
    }
}

.center-bubble {
    font-size: 36px;
    animation: center-bubble-burst 0.5s ease-out forwards;
    text-shadow: 0 0 20px #3b82f6;
}

@keyframes center-bubble-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 灰尘/复古特效 */
.effect-dust {
    font-size: 20px;
    color: rgba(180, 150, 100, 0.9);
    text-shadow: 0 0 5px rgba(180, 150, 100, 0.5);
    animation: dust-drift 0.7s ease-out forwards;
}

@keyframes dust-drift {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.center-dust {
    font-size: 32px;
    animation: center-dust-burst 0.5s ease-out forwards;
    filter: sepia(0.5);
}

@keyframes center-dust-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 紫色花瓣特效 */
.effect-petal {
    font-size: 26px;
    animation: petal-drift 0.8s ease-out forwards;
    text-shadow: 0 0 10px #9333ea;
}

@keyframes petal-drift {
    0% {
        transform: scale(0) rotate(0deg) translateX(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(180deg) translateX(-10px);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg) translateX(-20px) translateY(-30px);
        opacity: 0;
    }
}

.center-petal {
    font-size: 18px;
    font-weight: bold;
    color: #9333ea;
    text-shadow: 0 0 20px #9333ea;
    animation: center-petal-burst 0.6s ease-out forwards;
}

@keyframes center-petal-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 薄荷特效 */
.effect-mintleaf {
    font-size: 24px;
    animation: mint-drift 0.8s ease-out forwards;
    text-shadow: 0 0 10px #10b981;
}

@keyframes mint-drift {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg) translateY(-30px);
        opacity: 0;
    }
}

.center-mintleaf {
    font-size: 40px;
    animation: center-mint-burst 0.5s ease-out forwards;
    text-shadow: 0 0 20px #10b981;
}

@keyframes center-mint-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 日落特效 */
.effect-flare {
    font-size: 26px;
    color: #f97316;
    text-shadow: 0 0 10px #f97316, 0 0 20px #ef4444;
    animation: flare-burst 0.7s ease-out forwards;
}

@keyframes flare-burst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.4);
        opacity: 1;
        text-shadow: 0 0 30px #f97316, 0 0 50px #ef4444;
    }
    100% {
        transform: scale(0) translateY(-40px);
        opacity: 0;
    }
}

.center-flare {
    font-size: 36px;
    animation: center-flare-burst 0.5s ease-out forwards;
    text-shadow: 0 0 30px #f97316, 0 0 50px #ef4444;
}

@keyframes center-flare-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 霓虹特效 */
.effect-neon {
    font-size: 24px;
    color: #f43f5e;
    text-shadow: 0 0 10px #f43f5e, 0 0 20px #8b5cf6, 0 0 30px #06b6d4;
    animation: neon-flash 0.7s ease-out forwards;
}

@keyframes neon-flash {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.2) rotate(90deg);
        text-shadow: 0 0 20px #f43f5e, 0 0 40px #8b5cf6;
    }
    50% {
        transform: scale(0.9) rotate(180deg);
        opacity: 1;
    }
    75% {
        transform: scale(1.1) rotate(270deg);
        text-shadow: 0 0 30px #06b6d4, 0 0 50px #10b981;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.center-neon {
    font-size: 40px;
    color: #f43f5e;
    text-shadow: 0 0 30px #f43f5e, 0 0 50px #8b5cf6, 0 0 70px #06b6d4;
    animation: center-neon-burst 0.5s ease-out forwards;
}

@keyframes center-neon-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* 极简点特效 */
.effect-dot {
    font-size: 20px;
    color: var(--text-secondary, #64748b);
    animation: dot-pop 0.5s ease-out forwards;
}

@keyframes dot-pop {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

.center-dot {
    font-size: 24px;
    color: var(--text-primary, #1e293b);
    animation: center-dot-burst 0.4s ease-out forwards;
}

@keyframes center-dot-burst {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* ========== Print Styles ========== */
@media print {
    .header, .footer, .theme-toggle, .modal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .post-card, .tool-card, .link-card {
        break-inside: avoid;
        border: 1px solid #ddd;
    }
}

/* ========== Theme Modal ========== */
.theme-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.theme-modal__content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.theme-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.theme-modal__header h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.theme-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 24px;
    line-height: 1;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-modal__close:hover {
    background: var(--primary);
    color: white;
}

.theme-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.theme-option.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.theme-option__icon {
    font-size: 28px;
}

.theme-option__name {
    font-size: var(--text-sm);
    color: var(--text-primary);
    text-align: center;
}

.theme-option.active .theme-option__name {
    color: white;
}

/* Mobile */
@media (max-width: 768px) {
    .theme-modal__grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--space-2);
    }
    
    .theme-option {
        padding: var(--space-3);
    }
    
    .theme-option__icon {
        font-size: 24px;
    }
}

/* ========== Tool Modal ========== */
.tool-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.tool-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.tool-modal__container {
    position: relative;
    z-index: 2;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 95%;
    max-width: 1000px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: toolModalSlideIn 0.3s ease;
}

@keyframes toolModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tool-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
    flex-shrink: 0;
}

.tool-modal__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.tool-modal__close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    font-size: 24px;
    line-height: 1;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-modal__close:hover {
    background: #e74c3c;
    color: white;
    transform: rotate(90deg);
}

.tool-modal__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-6);
    background: var(--bg-primary);
}

/* 工具内容样式优化 */
.tool-modal__body .tool-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

.tool-modal__body .tool-section-title {
    display: none;
}

.tool-modal__body .tool-input-section {
    margin-bottom: var(--space-5);
}

.tool-modal__body .tool-input-row {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.tool-modal__body .tool-input-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: var(--space-4);
}

.tool-modal__body .tool-input-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.tool-modal__body .tool-input-group input,
.tool-modal__body .tool-input-group select,
.tool-modal__body .tool-input-group textarea {
    width: 100%;
    padding: var(--space-3);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: var(--text-base);
    transition: border-color 0.2s ease;
}

.tool-modal__body .tool-input-group input:focus,
.tool-modal__body .tool-input-group select:focus,
.tool-modal__body .tool-input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.tool-modal__body .tool-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.tool-modal__body .tool-btn-primary,
.tool-modal__body .tool-btn-secondary {
    flex: 1;
    min-width: 120px;
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-modal__body .tool-btn-primary {
    background: var(--primary);
    color: white;
}

.tool-modal__body .tool-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.tool-modal__body .tool-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.tool-modal__body .tool-btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.tool-modal__body .tool-help-section {
    margin-top: var(--space-5);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.tool-modal__body .tool-help-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.tool-modal__body .tool-help-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tool-modal__body .tool-help-list li {
    padding: var(--space-2) 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    position: relative;
    padding-left: var(--space-4);
}

.tool-modal__body .tool-help-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.tool-modal__body .tool-output {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-top: var(--space-4);
    min-height: 100px;
}

.tool-modal__body .tool-output-section {
    margin-top: var(--space-5);
}

.tool-modal__body .tool-output-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.tool-modal__body .tool-result-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-4);
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.tool-modal__iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    display: block;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .tool-modal__iframe {
        height: calc(100vh - 60px);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .tool-modal__container {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .tool-modal__header {
        padding: var(--space-3) var(--space-4);
        min-height: 50px;
    }
    
    .tool-modal__title {
        font-size: var(--text-base);
    }
    
    .tool-modal__close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .tool-modal__body {
        padding: var(--space-4);
    }
}

/* ========== Post List Item (列表样式) ========== */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.post-list-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--space-4);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.post-list-item:hover {
    border-color: var(--primary);
    background: var(--card-hover);
    box-shadow: var(--shadow-sm);
}

.post-list-item__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.post-list-item__title {
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    flex: 1;
}

.post-list-item__title:hover {
    color: var(--primary);
}

.post-list-item__date {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.post-list-item__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.post-list-item__badge {
    display: inline-flex;
    padding: var(--space-1) var(--space-2);
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-list-item__badge--accent {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

.post-list-item__excerpt {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.post-list-item__footer {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .post-list-item {
        padding: var(--space-3);
    }
    
    .post-list-item__header {
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .post-list-item__date {
        align-self: flex-start;
    }
    
    .post-list-item__title {
        font-size: var(--text-base);
    }
}
