/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--bg-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

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

/* 工具网格 */
.featured-tools,
.features,
.latest-articles {
    padding: 4rem 0;
}

.featured-tools h3,
.features h3,
.latest-articles h3 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

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

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.tool-card p {
    color: var(--text-light);
}

/* 功能特色 */
.features {
    background: var(--bg-white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.feature p {
    color: var(--text-light);
}

/* 文章网格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

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

.article-card h4 {
    margin-bottom: 1rem;
}

.article-card h4 a {
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}

.article-card h4 a:hover {
    color: var(--primary-color);
}

.article-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.article-card time {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* 广告位样式 */
.ad-section {
    padding: 2rem 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.ad-banner,
.ad-sidebar {
    min-height: 100px;
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.ad-banner {
    min-height: 120px;
}

.ad-sidebar {
    min-height: 250px;
    max-width: 300px;
    margin: 0 auto;
}

.ad-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: block;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.ad-content:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.ad-content h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.ad-content p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 页脚 */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: var(--transition);
}

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

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* 工具页面样式 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
}

.tool-item {
    display: flex;
    flex-direction: column;
}

.tool-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.tool-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.tool-card.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f9ff, white);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.tool-card.active .arrow {
    transform: rotate(180deg);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.tool-card h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.2rem;
    font-weight: 600;
}

.tool-card p {
    margin: 0 0 1rem 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
}

.expand-indicator {
    position: absolute;
    bottom: 10px;
    right: 20px;
    color: #9ca3af;
}

.arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

/* 工具面板 */
.tool-panel {
    display: none;
    background: white;
    border: 2px solid var(--primary-color);
    border-top: none;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

.tool-panel.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 1000px;
    }
}

.panel-header {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-content {
    padding: 1.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group textarea,
.input-group input[type="text"],
.input-group input[type="number"],
.input-group input[type="datetime-local"],
.input-group select {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #fafbfc;
}

.input-group textarea:focus,
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    color: #6b7280;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f9ff;
}

.btn-copy {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #059669;
}

.btn-convert {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-convert:hover {
    background: #2563eb;
}

/* 特定工具样式 */
.password-config {
    margin-bottom: 1.5rem;
}

.config-row {
    margin-bottom: 1rem;
}

.config-row input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 0;
}

.result-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.result-row input {
    flex: 1;
    margin-bottom: 0;
}

.strength-bar {
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
}

.stats-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.current-time {
    text-align: center;
    background: #f0f9ff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #1e40af;
    font-weight: 500;
}

.convert-section {
    margin-bottom: 1.5rem;
}

.convert-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.convert-row label {
    width: 100px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0;
}

.convert-input {
    flex: 1;
    display: flex;
    gap: 0.5rem;
}

.convert-input input {
    flex: 1;
    margin-bottom: 0;
}

.conversion-arrow {
    text-align: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
    margin: 0.5rem 0;
}

.result-display {
    margin-top: 1.5rem;
}

.result-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

.color-picker-section {
    margin-bottom: 2rem;
}

.color-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.color-display input[type="color"] {
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.color-display input[type="color"]:hover {
    transform: scale(1.05);
}

.color-preview {
    width: 80px;
    height: 80px;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-row label {
    width: 60px;
    font-weight: 500;
    margin-bottom: 0;
}

.color-input {
    flex: 1;
    display: flex;
    gap: 0.5rem;
}

.color-input input {
    flex: 1;
    margin-bottom: 0;
    font-family: monospace;
}

.calculator {
    max-width: 300px;
    margin: 0 auto;
}

.calc-display {
    width: 100%;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: right;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.calc-btn {
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

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

.calc-btn.operator:hover {
    background: #2563eb;
}

.calc-btn.equals {
    background: #10b981;
    color: white;
    border-color: #10b981;
    grid-row: span 2;
}

.calc-btn.equals:hover {
    background: #059669;
}

.calc-btn.zero {
    grid-column: span 2;
}

.unit-selector {
    margin-bottom: 1.5rem;
}

.unit-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.conversion-area {
    margin-bottom: 1.5rem;
}

.conversion-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.conversion-row input,
.conversion-row select {
    flex: 1;
    margin-bottom: 0;
}

.regex-options {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.regex-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 0;
}

.regex-result {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    min-height: 60px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #374151;
}

.error-message {
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

/* 新增工具样式 */
.tab-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.tab-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #e5e7eb;
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.multiple-results {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.multiple-results .result-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lottery-config {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.lottery-config .config-row {
    margin-bottom: 0;
}

.lottery-result {
    background: #f0f9ff;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-top: 1.5rem;
}

.lottery-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.lottery-number {
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.strength-indicator {
    margin-top: 1rem;
    text-align: center;
}

.strength-weak {
    color: #ef4444;
}

.strength-medium {
    color: #f59e0b;
}

.strength-strong {
    color: #10b981;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .tool-card {
        padding: 1.5rem 1rem;
    }
    
    .tool-icon {
        font-size: 2.5rem;
    }
    
    .panel-header {
        padding: 1rem;
    }
    
    .panel-content {
        padding: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .stats-display {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .convert-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .convert-row label {
        width: auto;
        margin-bottom: 0.5rem;
    }
    
    .color-display {
        flex-direction: column;
        gap: 1rem;
    }
    
    .calc-buttons {
        gap: 0.25rem;
    }
    
    .calc-btn {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .lottery-config {
        grid-template-columns: 1fr;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
}

/* 特定工具样式 */
.password-options {
    margin-bottom: 1rem;
}

.length-control {
    margin-bottom: 0.5rem;
}

.length-control input[type="range"] {
    width: 100%;
    margin: 0.25rem 0;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.password-result {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.password-result input {
    flex: 1;
    margin-bottom: 0;
}

.strength-meter {
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0;
}

.color-preview {
    width: 60px;
    height: 60px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.color-values {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.color-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-value label {
    width: 40px;
    font-size: 0.85rem;
    font-weight: 500;
}

.color-value input {
    flex: 1;
    margin-bottom: 0;
}

.time-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.time-group label {
    width: 80px;
    font-size: 0.85rem;
}

.time-group input {
    flex: 1;
    margin-bottom: 0;
}

.time-result {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.converter-group {
    margin-bottom: 1rem;
}

.conversion-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.conversion-inputs span {
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
}

.conversion-result input {
    background: #f8fafc;
    font-weight: 500;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-calc {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-calc:hover {
    background: #f3f4f6;
}

.btn-calc.operator {
    background: #3b82f6;
    color: white;
}

.btn-calc.operator:hover {
    background: #2563eb;
}

.btn-calc.equals {
    background: #10b981;
    color: white;
    grid-row: span 2;
}

.btn-calc.equals:hover {
    background: #059669;
}

.btn-calc.zero {
    grid-column: span 2;
}

.regex-result {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 6px;
    min-height: 2rem;
    margin-top: 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
}

.text-stats {
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.tool-result {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    margin-top: 0.75rem;
}

.tool-result canvas {
    max-width: 100%;
    height: auto;
}

/* 老版本工具容器样式保持兼容 */
.tool-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.tool-container h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.btn-tool {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn-tool:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.result-container {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* 播放器样式 */
.player-container {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.video-player {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.player-controls {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
    }

    .nav.active {
        display: flex;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

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

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

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .player-controls {
        flex-direction: column;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 2rem 0;
    }

    .featured-tools,
    .features,
    .latest-articles {
        padding: 2rem 0;
    }

    .tool-container {
        padding: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 工具特定样式 */
.color-preview {
    width: 100px;
    height: 100px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.qr-code-result {
    text-align: center;
    margin-top: 1rem;
}

.qr-code-result canvas {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.strength-weak { color: #ef4444; }
.strength-medium { color: #f59e0b; }
.strength-strong { color: #10b981; }

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 侧边栏广告样式 */
.sidebar-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: none; /* 默认隐藏，JavaScript控制显示 */
}

.sidebar-ad.left {
    left: 20px;
}

.sidebar-ad.right {
    right: 20px;
}

.sidebar-ad-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}

.sidebar-ad-content:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.sidebar-ad-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-ad-close:hover {
    background: var(--primary-color);
}

/* 响应式：移动端隐藏侧边栏广告 */
@media (max-width: 1400px) {
    .sidebar-ad {
        display: none !important;
    }
}

/* 确保主要内容不被侧边栏广告遮挡 */
@media (min-width: 1400px) {
    .container {
        max-width: 1000px; /* 在大屏幕上稍微缩小内容宽度 */
    }
}

/* 广告拦截器提示样式 */
.adblock-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    max-width: 300px;
}

.notice-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.notice-content p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notice-content button {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
}

/* 隐私同意对话框样式 */
.consent-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.consent-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.consent-content h3 {
    margin: 0 0 1rem 0;
    color: var(--text-dark);
}

.consent-options {
    margin: 1.5rem 0;
}

.consent-options label {
    display: block;
    margin: 0.5rem 0;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.consent-options label:hover {
    background: var(--bg-light);
}

.consent-options input[type="radio"] {
    margin-right: 0.5rem;
}

.consent-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.consent-buttons button {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.consent-buttons button:first-child {
    background: var(--primary-color);
    color: white;
}

.consent-buttons button:first-child:hover {
    background: var(--secondary-color);
}

.consent-buttons button:last-child {
    background: var(--text-light);
    color: white;
}

/* Amazon产品推荐样式 */
.amazon-products {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
}

.amazon-products h4 {
    margin: 0 0 1rem 0;
    color: var(--text-dark);
    text-align: center;
}

.amazon-product {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.amazon-product:last-child {
    border-bottom: none;
}

.amazon-product:hover {
    background: var(--bg-light);
}

.amazon-product img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.product-info {
    flex: 1;
}

.product-info h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.product-info .price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
}

.product-info a {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3rem 0.8rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    transition: var(--transition);
}

.product-info a:hover {
    background: var(--secondary-color);
}

/* 后备广告样式 */
.fallback-ad {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.fallback-ad .ad-content {
    color: white;
    text-decoration: none;
    display: block;
    transition: var(--transition);
}

.fallback-ad .ad-content:hover {
    transform: translateY(-2px);
}

.fallback-ad.banner .ad-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.fallback-ad.banner .ad-text p {
    margin: 0 0 1rem 0;
    opacity: 0.9;
}

.fallback-ad.banner .cta {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 600;
}

.fallback-ad.sidebar {
    padding: 1rem;
}

.fallback-ad.sidebar .ad-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.fallback-ad.sidebar h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.fallback-ad.sidebar p {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

.fallback-ad.sidebar .cta {
    font-size: 0.8rem;
    font-weight: 600;
}

.fallback-ad.article {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.fallback-ad.article .ad-image {
    font-size: 2.5rem;
}

.fallback-ad.article .ad-text h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
}

.fallback-ad.article .ad-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 响应式广告样式 */
@media (max-width: 768px) {
    .consent-content {
        padding: 1.5rem;
    }
    
    .consent-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .adblock-notice {
        position: relative;
        top: auto;
        right: auto;
        margin: 1rem;
        max-width: none;
    }
    
    .amazon-product {
        flex-direction: column;
        text-align: center;
    }
    
    .amazon-product img {
        align-self: center;
    }
    
    .fallback-ad.article {
        flex-direction: column;
        text-align: center;
    }
    
    /* 移动端隐藏侧边栏广告 */
    .sidebar-ads {
        display: none !important;
    }
}

/* 新增的广告样式 */
/* AdSense 增强样式 */
.adsense-banner {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1rem;
    margin: 2rem auto;
    min-height: 120px;
    max-width: 728px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.adsense-banner.loaded {
    background: transparent;
    border: none;
    padding: 0;
}

/* 侧边栏广告 */
.sidebar-ads {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-ad {
    width: 160px;
    height: 600px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
}

.sidebar-ad.loaded {
    background: transparent;
    border: none;
}

/* 底部广告 */
.footer-ad {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1rem;
    margin: 3rem auto;
    min-height: 100px;
    max-width: 970px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-ad.loaded {
    background: transparent;
    border: none;
    padding: 0;
}

/* 广告占位符文字 */
.adsense-ad:not(.loaded)::before {
    content: "AdSense 广告位";
    color: #94a3b8;
    font-size: 0.9rem;
}

/* PopCash 弹窗样式 */
.popup-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.popup-ad-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.popup-close:hover {
    color: #333;
} 