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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 导航栏 ========== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 0.5rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}

.logo-text h1 {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

.logo-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
}

.nav-links {
    display: flex;
    gap: 0.75rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.15rem;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-toggle:active {
    background: rgba(255, 255, 255, 0.35);
}

/* ========== Hero区域 ========== */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 2rem 2rem;
    color: white;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
}

.hero-text {
    text-align: center;
    margin-bottom: 1.5rem;
}

.hero-text h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-text p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 160px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ========== 搜索区域 ========== */
.search-section {
    padding: 2rem;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 1.25rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-icon {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-right: 1rem;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.5rem;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========== 标签页区域 ========== */
.tabs-section {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
}

.tabs-container {
    width: 100%;
}

.tabs-nav {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    overflow: hidden;
    background: white;
    padding: 0.75rem 0.75rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.tab-btn {
    background: #f3f4f6;
    color: var(--text-secondary);
    border: none;
    padding: 0.75rem 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 500;
    font-size: 0.8125rem;
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    white-space: nowrap;
}

.tab-btn i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tab-btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.tab-btn .badge {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tab-btn.active .badge {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== 主内容区域 ========== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    padding-bottom: 4rem;
}

/* ========== 软件卡片 ========== */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.software-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.software-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.software-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.software-card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.brand-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.type-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    font-size: 0.8rem;
    background: #f3f4f6;
    color: var(--text-secondary);
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.card-icon.brand-hikvision {
    background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
}

.card-icon.brand-dahua {
    background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
}

.card-icon.brand-huawei {
    background: linear-gradient(135deg, #F57C00 0%, #E65100 100%);
}

.card-icon.brand-uniview {
    background: linear-gradient(135deg, #8E24AA 0%, #6A1B9A 100%);
}

.card-icon.brand-tiandy {
    background: linear-gradient(135deg, #00ACC1 0%, #00838F 100%);
}

.card-icon.brand-universal {
    background: linear-gradient(135deg, #607D8B 0%, #455A64 100%);
}

.card-icon.brand-other {
    background: linear-gradient(135deg, #78909C 0%, #546E7A 100%);
}

.brand-initial {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.software-card:hover .card-icon {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    align-items: center;
}

.card-stats span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
    text-align: center;
    line-height: 1.3;
}

.card-stats span i {
    flex-shrink: 0;
    width: 1em;
    text-align: center;
}

.download-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    transition: all 0.3s ease;
    text-decoration: none;
}

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

.download-btn:active {
    transform: translateY(0);
}

/* ========== 加载状态 ========== */
.loading-state {
    text-align: center;
    padding: 4rem;
}

.spinner {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 4rem;
}

.empty-icon {
    width: 100px;
    height: 100px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-icon i {
    font-size: 3rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ========== 管理页面样式 ========== */
.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    padding-bottom: 4rem;
}

/* 登录面板 */
.login-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
}

.login-card h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.login-hint {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* 管理面板 */
.admin-panel {
    animation: fadeIn 0.3s ease;
}

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

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

.admin-stat {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    min-width: 200px;
}

.admin-stat .stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.admin-stat .stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.admin-stat .stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.admin-stat .stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* 面板区域 */
.panel-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.panel-header h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 按钮样式 */
.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-success:hover {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-block {
    width: 100%;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
}

.data-table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.data-table tr:hover {
    background: #f9fafb;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.action-cell {
    text-align: center;
    white-space: nowrap;
}

.edit-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.delete-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ========== 页脚 ========== */
.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 2rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-left h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.footer-left p {
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-contact span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
}

.footer-center h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

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

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

.footer-center a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-center a:hover {
    color: white;
}

.footer-right {
    text-align: right;
}

.footer-right h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.footer-right p {
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

/* ========== 通知组件 ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.notification i {
    font-size: 1.25rem;
    color: white;
}

.notification span {
    color: white;
    font-weight: 500;
}

/* ========== 模态框样式 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modalFadeIn 0.2s ease;
}

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

.modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* ========== 品牌颜色 ========== */
.brand-hikvision { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%); }
.brand-dahua { background: linear-gradient(135deg, #4ecdc4 0%, #3dbdb6 100%); }
.brand-huawei { background: linear-gradient(135deg, #ff9f43 0%, #ee8f33 100%); }
.brand-uniview { background: linear-gradient(135deg, #5f27cd 0%, #4e1fbc 100%); }
.brand-tiandy { background: linear-gradient(135deg, #00d2d3 0%, #00c2c3 100%); }
.brand-other { background: linear-gradient(135deg, #95a5a6 0%, #859596 100%); }
.brand-universal { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }

/* ========== 响应式设计 ========== */

@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-content {
        max-width: 1600px;
    }
    
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 1.5rem;
    }
    
    .stat-card {
        min-width: 200px;
        padding: 1.25rem 2rem;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-text p {
        font-size: 1.1rem;
    }
    
    .tabs-nav {
        gap: 0.4rem;
    }
    
    .tab-btn {
        padding: 0.75rem 0.35rem;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    .software-card {
        padding: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 1100px;
    }
    
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    .hero-text h1 {
        font-size: 2.25rem;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 900px;
    }
    
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .hero-text p {
        font-size: 0.95rem;
    }
    
    .stat-card {
        min-width: 140px;
        padding: 0.75rem 1.25rem;
    }
    
    .tab-btn {
        padding: 0.75rem 0.35rem;
        font-size: 0.8rem;
        min-height: 44px;
    }
    
    .software-card {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        padding: 0.625rem 1rem;
        padding-top: calc(0.625rem + env(safe-area-inset-top));
    }

    .logo {
        flex: 1;
        min-width: 0;
    }

    .logo-text h1 {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .logo-subtitle {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.35rem;
        padding: 0.75rem 0 0.25rem;
        order: 3;
    }

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

    .nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 8px;
        min-height: 44px;
    }

    .hero-section {
        padding: 1.25rem 1rem;
    }

    .hero-text {
        margin-bottom: 1rem;
    }

    .hero-text h1 {
        font-size: 1.35rem;
        line-height: 1.35;
    }

    .hero-text p {
        font-size: 0.85rem;
        line-height: 1.5;
        padding: 0 0.25rem;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        align-items: stretch;
    }

    .stat-card {
        width: auto;
        max-width: none;
        min-width: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 0.35rem;
        padding: 0.65rem 0.4rem;
        border-radius: 10px;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .stat-value {
        font-size: 1.05rem;
        line-height: 1.2;
    }

    .stat-label {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    .search-section {
        padding: 0.75rem 1rem;
    }

    .search-box {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: 12px;
    }

    .search-icon {
        margin-right: 0;
        font-size: 1rem;
    }

    .search-box input {
        font-size: 16px;
        padding: 0.625rem 0.25rem;
        min-width: 0;
    }

    .search-btn {
        width: auto;
        flex-shrink: 0;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
    }

    .tabs-section {
        max-width: none;
        padding: 0 1rem;
        margin-bottom: 1rem;
    }

    .tabs-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.5rem;
        padding: 0.75rem;
        border-radius: 12px;
    }

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

    .tab-btn {
        flex: 0 0 auto;
        width: auto;
        flex-shrink: 0;
        justify-content: center;
        padding: 0.75rem 0.875rem;
        font-size: 0.85rem;
        white-space: nowrap;
        min-height: 44px;
    }

    .main-content {
        padding: 0 1rem 2rem;
    }

    .software-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .software-card {
        padding: 1rem;
        border-radius: 14px;
    }

    .software-card:hover {
        transform: none;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .brand-badge,
    .type-badge {
        font-size: 0.75rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-icon {
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    .brand-initial {
        font-size: 1.2rem;
    }

    .card-title {
        font-size: 1.05rem;
    }

    .card-description {
        font-size: 0.85rem;
        -webkit-line-clamp: 3;
    }

    .card-stats {
        gap: 0.25rem;
        font-size: 0.72rem;
    }

    .card-stats span {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.25rem 0.1rem;
    }

    .card-stats span i {
        font-size: 0.85rem;
    }

    .download-btn {
        min-height: 44px;
        font-size: 0.95rem;
    }

    .form-row {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        min-height: 44px;
    }

    .action-btns {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer {
        padding: 2rem 1rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-right {
        text-align: center;
    }

    .footer-contact span {
        justify-content: center;
        font-size: 0.9rem;
    }

    .notification {
        left: 1rem;
        right: 1rem;
        top: calc(1rem + env(safe-area-inset-top));
    }

    .modal-content {
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem - env(safe-area-inset-top));
        border-radius: 16px;
    }

    .modal-body {
        padding: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    .table-scroll {
        margin: 0 -0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        display: table;
        min-width: 640px;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .hero-text h1 {
        font-size: 1.2rem;
    }

    .login-card {
        padding: 2rem 1.25rem;
        border-radius: 16px;
    }

    .admin-main {
        padding: 1rem 0.75rem 2rem;
    }
}

@media (max-width: 1024px) {
    .admin-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-main {
        padding: 1rem;
    }

    .admin-panel {
        padding: 0;
    }

    .admin-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0.5rem;
        gap: 0.35rem;
    }

    .admin-tabs::-webkit-scrollbar {
        display: none;
    }

    .admin-tab-btn {
        width: auto;
        flex-shrink: 0;
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
        min-height: 40px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .admin-stat.stat-card {
        min-width: 0;
        padding: 0.75rem;
    }

    .panel-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .panel-header h2 {
        font-size: 1.1rem;
    }

    .header-actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: 0.5rem;
    }

    .header-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
        min-height: 44px;
        font-size: 0.85rem;
        padding: 0.625rem 0.75rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .filter-group {
        width: 100%;
        flex-wrap: wrap;
    }

    .filter-group select,
    .filter-search input {
        flex: 1;
        min-width: 0;
        width: 100%;
        font-size: 16px;
    }

    .filter-search {
        flex-wrap: wrap;
    }

    .filter-search input {
        min-width: 0;
    }

    .batch-actions {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .batch-actions .btn {
        flex: 1;
        min-height: 44px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.category-tab {
    margin-bottom: 2rem;
}

.category-tab h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-preview {
    width: 40px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
}

input[type="color"] {
    height: 40px;
    padding: 2px;
    border-radius: 6px;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.required {
    color: var(--danger-color);
    margin-left: 4px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-resolved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.display-yes {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
}

.display-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
}

.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.5rem;
    border-radius: 10px;
}

.pagination-btn {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: transparent;
    color: white;
    font-weight: 600;
}

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

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 1rem;
    padding: 0.5rem;
}

/* ========== 筛选栏样式 ========== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 120px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.filter-search input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    min-width: 220px;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.batch-actions label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    font-weight: 500;
}

.batch-actions input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ========== 管理后台标签页样式 ========== */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.admin-tab-btn {
    background: #f3f4f6;
    color: var(--text-secondary);
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.admin-tab-btn .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.admin-tab-btn .badge-error {
    background: #ef4444;
}

.admin-tab-btn .badge-submission {
    background: #3b82f6;
}

.admin-tab-btn:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.modal-content-wide {
    max-width: 720px;
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.changelog-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    background: #f8fafc;
}

.changelog-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.changelog-item-head h4 {
    margin: 0;
    font-size: 1rem;
    color: #1f2937;
    flex: 1 1 auto;
}

.changelog-item-head time {
    font-size: 0.82rem;
    color: #6b7280;
}

.changelog-version {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    font-size: 0.78rem;
    font-weight: 600;
}

.changelog-item-body {
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.7;
}

.changelog-loading,
.changelog-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem 1rem;
}

.reserved-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
}

.tab-btn-tool.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.tab-btn-tool:not(.active) {
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.type-badge-tool {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.changelog-empty i,
.changelog-loading i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.panel-tip {
    margin: 0 0 1rem;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.sync-log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    color: #4b5563;
    font-size: 0.9rem;
}

.sync-log-summary {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    max-height: 50vh;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}