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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

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

header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}

.dark-mode header {
    background: rgba(26,26,46,0.95);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo .subtitle {
    font-size: 0.8rem;
    color: #666;
    display: block;
}

.dark-mode .logo .subtitle {
    color: #aaa;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.dark-mode .nav-links a {
    color: #ccc;
}

.theme-toggle .theme-btn {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: transform 0.3s;
    display: inline-block;
}

.theme-toggle .theme-btn:hover {
    transform: scale(1.2);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    border-radius: 3px;
    transition: all 0.3s;
}

.dark-mode .hamburger span {
    background: #e0e0e0;
}

.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 0 0 50px 50px;
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: rgba(255,255,255,0.9);
}

.dark-mode .search-box input {
    background: rgba(255,255,255,0.1);
    border-color: #444;
    color: #e0e0e0;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102,126,234,0.2);
}

.search-box button {
    padding: 15px 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.dark-mode .filter-btn {
    border-color: #764ba2;
    color: #764ba2;
}

.filter-btn:hover, .filter-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
}

.apps-grid h3 {
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.apps-grid h3 span {
    color: #667eea;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.dark-mode .card {
    background: rgba(255,255,255,0.08);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(102,126,234,0.3);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.dark-mode .card h4 {
    color: #e0e0e0;
}

.card .desc {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    flex: 1;
}

.dark-mode .card .desc {
    color: #aaa;
}

.card .meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.card .meta span {
    background: rgba(102,126,234,0.1);
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.dark-mode .card .meta span {
    background: rgba(255,255,255,0.1);
}

.card .reviews {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(102,126,234,0.05);
    border-radius: 10px;
}

.dark-mode .card .reviews {
    background: rgba(255,255,255,0.05);
}

.review-item {
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.review-user {
    font-weight: 600;
    color: #667eea;
}

.review-text {
    color: #666;
}

.dark-mode .review-text {
    color: #aaa;
}

.download-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    margin-top: auto;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102,126,234,0.5);
}

footer {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
}

.dark-mode footer {
    background: rgba(26,26,46,0.9);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #764ba2;
}

footer p {
    color: #888;
    font-size: 0.9rem;
}

/* 登录表单 */
.login-form {
    max-width: 400px;
    margin: 80px auto;
    padding: 40px;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.dark-mode .login-form {
    background: rgba(255,255,255,0.08);
}

.login-form h2 {
    margin-bottom: 30px;
    text-align: center;
    color: #667eea;
}

.login-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.dark-mode .login-form input {
    background: rgba(255,255,255,0.1);
    border-color: #444;
    color: #e0e0e0;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-form button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.login-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 15px;
}

/* 管理后台表格 */
.admin-controls {
    margin: 30px 0;
}

.admin-controls button {
    padding: 12px 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.admin-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.add-form, .edit-form {
    background: rgba(255,255,255,0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.dark-mode .add-form, .dark-mode .edit-form {
    background: rgba(255,255,255,0.08);
}

.add-form h3, .edit-form h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.add-form input, .add-form select, .edit-form input, .edit-form select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
}

.dark-mode .add-form input, .dark-mode .add-form select,
.dark-mode .edit-form input, .dark-mode .edit-form select {
    background: rgba(255,255,255,0.1);
    border-color: #444;
    color: #e0e0e0;
}

.add-form button, .edit-form button {
    padding: 12px 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s;
}

.add-form button:hover, .edit-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.dark-mode .admin-table {
    background: rgba(255,255,255,0.08);
}

.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.dark-mode .admin-table th, .dark-mode .admin-table td {
    border-bottom-color: #444;
}

.admin-table th {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 600;
}

.admin-table td button {
    padding: 8px 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
    transition: all 0.3s;
}

.admin-table td button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

/* 内页通用样式 */
.page-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 0 0 30px 30px;
    margin-bottom: 40px;
}

.page-hero h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.page-hero p {
    opacity: 0.9;
}

.history-list {
    list-style: none;
    padding: 0;
}

.history-list li {
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.dark-mode .history-list li {
    background: rgba(255,255,255,0.08);
}

.history-list li:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(102,126,234,0.2);
}

.history-list .icon {
    font-size: 2rem;
}

.history-list .info {
    flex: 1;
}

.history-list .info h4 {
    margin-bottom: 5px;
}

.history-list .info p {
    color: #666;
    font-size: 0.9rem;
}

.dark-mode .history-list .info p {
    color: #aaa;
}

.history-list .download-link {
    padding: 10px 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.history-list .download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 20px 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 15px;
        text-align: center;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .theme-toggle {
        order: -1;
    }

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

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

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box button {
        width: 100%;
    }

    .admin-table {
        font-size: 0.85rem;
    }

    .admin-table th, .admin-table td {
        padding: 10px;
    }

    .history-list li {
        flex-direction: column;
        text-align: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}