/* 在原有样式基础上添加以下内容 */

/* 搜索和过滤 */
.search-filter {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 300px;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
}

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

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

/* 微服务网格 */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.app-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.app-image {
    height: 180px;
    overflow: hidden;
}

.app-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.app-card:hover .app-image img {
    transform: scale(1.05);
}

.app-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-title {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.app-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.app-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.app-category {
    background: #f0f7ff;
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.app-actions {
    display: flex;
    gap: 10px;
}

.app-link, .download-btn {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

.app-link:hover {
    background: #3a5a8c;
    color: white;
}

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

.download-btn:hover {
    background: #218838;
    color: white;
}

/* 无结果提示 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 2px dashed #dee2e6;
}

/* 图片占位符 */
.image-placeholder {
    height: 180px;
    background: linear-gradient(135deg, #4a6fa5, #6b8cbc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 应用统计 */
.app-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* 页脚内容 */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

/* 统计容器增强 */
.stats-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.stats-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    transform: rotate(30deg);
}

.stats-container h3 {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stats-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.stat-item {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.2);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

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

/* 表单验证样式 */
.form-control:invalid {
    border-color: var(--danger-color);
}

.form-control:valid {
    border-color: var(--success-color);
}

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons form,
    .action-buttons button {
        width: 100%;
    }
    
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .category-filter {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
}

/* 安全提示 */
.security-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    font-size: 0.9rem;
}

.security-note strong {
    display: block;
    margin-bottom: 0.5rem;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 密码输入组 */
.password-input-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.toggle-password:hover {
    color: var(--primary-color);
}
/* 在原有样式基础上添加以下移动端优化内容 */

/* ===== 移动端优先的响应式设计 ===== */

/* 基础移动端优化 */
body {
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* 移动端触摸友好按钮 */
.btn,
.nav-link,
.app-link,
.download-btn,
.quick-action-btn,
.sort-btn,
.category-btn {
    min-height: 44px; /* 最小触摸区域 */
    min-width: 44px;
    padding: 10px 15px;
    font-size: 16px; /* 防止iOS缩放 */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
    touch-action: manipulation; /* 优化触摸响应 */
}

/* 移动端导航优化 */
.header-content {
    flex-direction: column;
    padding: 10px 0;
}

.header-content h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 10px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.nav-link {
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
}

/* 移动端表单优化 */
.form-control {
    font-size: 16px; /* 防止iOS缩放 */
    padding: 12px 15px;
    min-height: 48px;
    box-sizing: border-box;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea {
    -webkit-appearance: none; /* 移除iOS默认样式 */
    border-radius: 8px;
    border: 1px solid #ddd;
    width: 100%;
}

/* 移动端表格优化 */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    margin: 15px 0;
}

table {
    min-width: 600px; /* 保证表格最小宽度 */
    font-size: 14px;
}

table th,
table td {
    padding: 10px 8px;
    word-break: break-word;
}

/* 移动端卡片优化 */
.app-card {
    margin: 0 auto;
    max-width: 100%;
}

.app-image {
    height: 150px;
}

/* 移动端模态框优化 */
.modal-content {
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* 移动端统计卡片优化 */
.dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.stat-card {
    padding: 15px;
}

.stat-number {
    font-size: 24px;
}

/* 移动端标签页优化 */
.admin-nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 5px;
}

.admin-nav-tab {
    padding: 8px 15px;
    font-size: 14px;
}

/* 移动端搜索过滤优化 */
.search-filter {
    flex-direction: column;
    gap: 15px;
}

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

.category-filter {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 10px;
}

/* 移动端微服务网格优化 */
.apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 移动端统计容器优化 */
.stats-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* 移动端按钮组优化 */
.action-buttons {
    flex-wrap: wrap;
    gap: 5px;
}

.action-buttons button,
.action-buttons form {
    min-width: auto;
    flex: 1;
}

/* 移动端星光采集申请优化 */
.star-collect-stats {
    flex-wrap: wrap;
    gap: 10px;
}

.star-stat-item {
    min-width: 45%;
    margin-bottom: 10px;
}

/* 移动端排序控制优化 */
.sort-controls {
    flex-wrap: wrap;
    gap: 5px;
}

.sort-input {
    width: 60px;
    padding: 5px;
}

/* 移动端密码显示按钮优化 */
.toggle-password {
    padding: 8px;
    right: 5px;
}

/* 移动端页脚优化 */
.footer-content {
    text-align: center;
    padding: 20px 0;
}

.footer-links {
    flex-direction: column;
    gap: 5px;
}

/* ===== 媒体查询 - 针对小屏幕设备 ===== */

@media (max-width: 768px) {
    /* 通用样式 */
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 10px;
    }

    /* 登录页面优化 */
    .login-container {
        margin: 20px auto;
        padding: 20px;
        width: 95%;
    }

    /* 管理后台优化 */
    .admin-panel {
        padding: 15px;
    }

    .admin-panel h2 {
        font-size: 1.3rem;
    }

    /* 表单行优化 */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-col {
        width: 100%;
    }

    /* 快速操作按钮 */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 星光采集申请页面 */
    .apply-container {
        padding: 20px;
        margin: 10px;
    }

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

    /* 问题反馈页面 */
    .form-container {
        padding: 15px;
    }

    /* 表格操作按钮 */
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons select {
        width: 100%;
        margin-bottom: 5px;
    }

    /* 统计卡片 */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        margin-bottom: 10px;
    }

    /* 微服务网格 */
    .apps-grid {
        grid-template-columns: 1fr;
    }

    /* 访问者表格 */
    .visitor-details table {
        font-size: 12px;
    }

    .visitor-details th,
    .visitor-details td {
        padding: 8px 5px;
    }

    /* 排序管理 */
    .sort-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .sort-batch-controls {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕设备优化 */
    .header-content h1 {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 5px;
    }

    .nav-link {
        font-size: 12px;
        padding: 6px 8px;
    }

    /* 登录页面 */
    .login-container {
        padding: 15px;
    }

    /* 统计卡片 */
    .stat-number {
        font-size: 20px;
    }

    /* 表格内容 */
    table {
        font-size: 12px;
    }

    /* 按钮 */
    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* 星光采集统计 */
    .star-collect-stats {
        flex-direction: column;
    }

    .star-stat-item {
        min-width: 100%;
    }

    /* 微服务卡片 */
    .app-card {
        margin: 10px 0;
    }

    .app-image {
        height: 120px;
    }

    /* 管理面板 */
    .admin-welcome {
        padding: 20px;
    }

    .admin-welcome h2 {
        font-size: 1.2rem;
    }

    /* 模态框 */
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    /* 排序输入 */
    .sort-input {
        width: 50px;
    }
}

/* ===== 移动端特殊优化 ===== */

/* 防止iOS输入框缩放 */
@media screen and (max-width: 767px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* 移动端滚动优化 */
html {
    -webkit-text-size-adjust: 100%; /* 防止字体缩放 */
    -webkit-font-smoothing: antialiased; /* 字体平滑 */
}

/* 移动端触摸反馈 */
.btn:active,
.nav-link:active,
.app-link:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

/* 移动端表单焦点样式 */
.form-control:focus {
    border-color: #4a6fa5;
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
    outline: none;
}

/* 移动端下拉菜单优化 */
select {
    -webkit-appearance: none;
    appearance: none;
    background: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>') no-repeat right 10px center/12px;
    padding-right: 30px;
}

/* 移动端图片优化 */
img {
    max-width: 100%;
    height: auto;
}

/* 移动端加载动画优化 */
.loading-spinner {
    width: 16px;
    height: 16px;
}

/* 移动端工具提示优化 */
.tooltip .tooltip-text {
    font-size: 12px;
    max-width: 150px;
    white-space: normal;
}

/* 移动端安全区域适配（iPhone X及以上） */
@supports (padding: max(0px)) {
    body, .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }

    .login-container,
    .apply-container,
    .form-container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* 移动端横屏优化 */
@media (orientation: landscape) and (max-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .header-content h1 {
        font-size: 1.2rem;
        margin-bottom: 0;
    }

    .nav-links {
        width: auto;
    }

    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 移动端暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }

    .app-card,
    .stat-card,
    .admin-panel,
    .login-container,
    .apply-container,
    .form-container {
        background-color: #2d2d2d;
        color: #ffffff;
        border: 1px solid #444;
    }

    .form-control {
        background-color: #333;
        color: #fff;
        border-color: #555;
    }

    table {
        background-color: #2d2d2d;
    }

    table th {
        background-color: #333;
        color: #fff;
    }

    table tr:nth-child(even) {
        background-color: #333;
    }
}
