/* Modern UI 优化 - 补充样式 */

/* ==================== 品牌和导航优化 ==================== */

.brand-icon {
    font-size: 1.5em;
    margin-right: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nav-icon {
    margin-right: 0.3rem;
    font-size: 1.1em;
}

.nav-menu a {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-menu a:hover .nav-icon {
    transform: scale(1.2);
}

/* ==================== 表单增强样式 ==================== */

.section-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.label-icon {
    margin-right: 0.4rem;
    font-size: 1.1em;
}

.label-required {
    color: #e74c3c;
    margin-left: 0.2rem;
}

/* 输入框包装器 */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .form-input {
    flex: 1;
    padding-right: 3rem;
}

/* 清除按钮 */
.btn-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: none;
    background: #95a5a6;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-clear:hover {
    background: #7f8c8d;
    transform: translateY(-50%) scale(1.1);
}

.btn-clear:active {
    transform: translateY(-50%) scale(0.95);
}

/* 帮助文本样式 */
.form-help {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.help-icon {
    margin-right: 0.4rem;
}

/* ==================== Turnstile容器优化 ==================== */

.turnstile-container {
    margin: 1.5rem 0;
}

.turnstile-wrapper {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px dashed #dee2e6;
}

/* ==================== 键盘快捷键提示 ==================== */

.keyboard-hint {
    margin-top: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.5rem;
    text-align: center;
    color: white;
    font-size: 0.875rem;
}

.keyboard-hint kbd {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 0.25rem;
    font-family: monospace;
    font-weight: bold;
    margin: 0 0.2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ==================== 统计面板 ==================== */

.stats-section {
    margin: 2rem 0;
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-section h3 {
    color: white;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* ==================== 结果显示优化 ==================== */

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.result-timestamp {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}

.ip-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #495057;
    background: #f8f9fa;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.status-badge.status-danger {
    background: #fee;
    color: #d32f2f;
}

.status-badge.status-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-neutral {
    background: #f5f5f5;
    color: #757575;
}

.count-value {
    font-weight: bold;
    color: #007bff;
}

/* ==================== 记录列表优化 ==================== */

.section-header-with-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-header-with-count h4 {
    margin: 0;
    font-size: 1.3rem;
}

.count-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: bold;
    color: white;
}

.count-badge.danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.count-badge.success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.section-hint {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

/* 删除按钮容器 */
.delete-button-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.delete-button-container:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
    transform: translateY(-2px);
}

.item-info {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.item-number {
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.item-details {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.item-details strong {
    color: #2c3e50;
}

.item-details small {
    color: #6c757d;
    display: block;
    margin-top: 0.25rem;
}

/* 动画效果 */
.animate-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 无记录状态优化 ==================== */

.no-records {
    text-align: center;
    padding: 3rem 2rem;
}

.no-records-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.no-records h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.no-records code {
    background: #f8f9fa;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: #e83e8c;
}

.no-records-hint {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ==================== 页脚优化 ==================== */

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0.5rem 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin: 0.5rem 0;
}

.footer-links a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: #0056b3;
    padding-left: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

.footer-bottom p {
    color: #6c757d;
    font-size: 0.875rem;
    margin: 0;
}

/* ==================== IP段和单个IP样式 ==================== */

/* IP段样式 */
.ip-range-item {
    border-left: 4px solid #ffc107 !important;
    background-color: #fff8e1 !important;
}

.ip-range-badge {
    background-color: #ffc107;
    color: #212529;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    font-weight: 600;
}

/* 单个IP样式 */
.single-ip-badge {
    background-color: #28a745;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
    font-weight: 600;
}

/* IP段的删除按钮禁用状态 */
.ip-range-item .btn-danger:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 提示信息样式 */
.result-tips {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 查询代码状态样式 */
.query-code-status {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #e8f5e8;
    border-radius: 0.5rem;
    border-left: 4px solid #28a745;
}

.status-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.status-value.active {
    color: #155724;
    font-weight: 600;
    margin-right: 1rem;
}

.expire-info {
    font-size: 0.85rem;
    color: #6c757d;
}

/* ==================== 响应式优化 ==================== */

@media (max-width: 768px) {
    .brand-icon {
        font-size: 1.2em;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .keyboard-hint {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .item-info {
        flex-direction: column;
    }
    
    .delete-button-container {
        padding: 0.75rem;
    }
    
    .btn-delete {
        width: 100%;
    }
}

/* ==================== 辅助功能优化 ==================== */

/* 焦点可见性 */
*:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* 减少动画 - 尊重用户偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== 打印样式 ==================== */

@media print {
    .navbar,
    .footer,
    .btn-delete,
    .stats-section,
    .keyboard-hint {
        display: none !important;
    }
    
    .result-container {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}
