* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo h1 {
    font-size: 1.5rem;
    color: #667eea;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: #667eea;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    color: white;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-box {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
}

.search-box button {
    padding: 1rem 2rem;
    background: #fff;
    color: #667eea;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Categories */
.categories {
    padding: 2rem 0;
}

.categories h2 {
    text-align: center;
    color: white;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    color: #333;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tab-btn.active {
    background: #fff;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Software Grid */
.software-list {
    padding: 2rem 0 4rem;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.software-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.software-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .software-card:hover {
        transform: none;
    }
    
    .software-card:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

.software-card.hidden {
    display: none;
}

.card-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    overflow: hidden;
}

.card-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.card-body {
    padding: 1.5rem;
}

.card-body h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.card-body .category-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #e0e7ff;
    color: #667eea;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.card-body p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.card-body .info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #888;
}

.download-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.download-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.download-btn-small {
    padding: 0.6rem 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.download-btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.download-btn-small:active {
    transform: translateY(0);
}

/* 移动端按钮触摸反馈 */
@media (hover: none) and (pointer: coarse) {
    .download-btn-small:hover {
        transform: none;
    }
    
    .download-btn-small:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    .tab-btn:active {
        transform: scale(0.95);
    }
    
    .search-box button:active {
        transform: scale(0.95);
    }
}

/* Footer */
footer {
    background: rgba(0,0,0,0.2);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

footer p {
    margin: 0.5rem 0;
}

/* 链接选择对话框 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.link-dialog {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    min-width: 320px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.link-dialog h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    text-align: center;
}

.link-dialog p {
    color: #666;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1rem;
}

.confirm-hint {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 1rem !important;
    margin-top: -0.5rem;
}

.link-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.link-choice-btn {
    flex: 1;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.link-choice-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.link-choice-btn:active {
    transform: translateY(0);
}

.close-dialog-btn {
    width: 100%;
    padding: 0.8rem;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.close-dialog-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* 关于对话框 */
.about-dialog {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.about-content {
    text-align: left;
    padding: 1rem 0;
}

.about-subtitle {
    font-size: 1.1rem;
    color: #667eea;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.about-section {
    margin-bottom: 1.5rem;
}

.about-section h4 {
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e7ff;
}

.about-section ul {
    list-style: none;
    padding-left: 0;
}

.about-section ul li {
    padding: 0.5rem 0;
    color: #555;
    line-height: 1.6;
}

.disclaimer {
    background: #fff3cd;
    padding: 1rem;
    border-radius: 8px;
    color: #856404;
    border-left: 4px solid #ffc107;
    line-height: 1.8;
}

.about-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #e0e7ff;
    text-align: center;
}

.about-footer p {
    margin: 0.5rem 0;
    color: #666;
}

.version {
    font-size: 0.9rem;
    color: #999 !important;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .search-box {
        flex-direction: column;
        padding: 0 1rem;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    .software-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* 移动端横向卡片布局 */
    .software-card {
        display: flex;
        flex-direction: row;
        height: auto;
        min-height: 140px;
    }

    .card-icon {
        width: 120px;
        min-width: 120px;
        height: 140px;
        flex-shrink: 0;
    }

    .card-icon img {
        width: 60px;
        height: 60px;
    }

    .card-body {
        flex: 1;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .card-body h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .card-body .category-tag {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .card-body p {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .card-body .info {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
    }

    .download-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.3rem;
    }

    .download-btn-small {
        padding: 0.5rem 0.2rem;
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .category-tabs {
        gap: 0.5rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* 移动端对话框优化 */
    .link-dialog {
        min-width: 90%;
        max-width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
        overflow-y: auto;
    }

    .link-dialog h3 {
        font-size: 1.3rem;
    }

    .link-dialog p {
        font-size: 0.95rem;
    }

    .link-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }

    .link-choice-btn {
        width: 100%;
        padding: 1.2rem;
        font-size: 1.1rem;
    }

    .close-dialog-btn {
        padding: 1rem;
        font-size: 1rem;
    }

    /* 关于对话框移动端优化 */
    .about-dialog {
        max-width: 95%;
        max-height: 85vh;
    }

    .about-subtitle {
        font-size: 1rem;
    }

    .about-section h4 {
        font-size: 1rem;
    }

    .about-section ul li {
        font-size: 0.9rem;
        padding: 0.4rem 0;
    }

    .disclaimer {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    /* 头部优化 */
    .logo h1 {
        font-size: 1.3rem;
    }

    /* 底部优化 */
    footer {
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }

    /* 分类标签优化 */
    .categories h2 {
        font-size: 1.5rem;
    }
}

/* 超小屏幕优化 (360px 及以下) */
@media (max-width: 360px) {
    .hero h2 {
        font-size: 1.5rem;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .tab-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    /* 超小屏幕下的横向卡片 */
    .card-icon {
        width: 100px;
        min-width: 100px;
        height: 130px;
    }

    .card-icon img {
        width: 50px;
        height: 50px;
    }

    .card-body {
        padding: 0.8rem;
    }

    .card-body h3 {
        font-size: 0.95rem;
    }

    .card-body p {
        font-size: 0.8rem;
    }

    .download-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .download-btn-small {
        padding: 0.6rem 0.3rem;
        font-size: 0.65rem;
    }
}
