/* ==============================
   网页工具箱 - 样式文件
   ============================== */

:root {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局 */
* { box-sizing: border-box; }

body {
    background: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
    padding-top: 76px;
    min-height: 100vh;
    color: #333;
}

/* 导航栏 - 玻璃效果 */
.glass-nav {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
    padding: 12px 0;
}

.glass-nav .navbar-brand {
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    font-size: 1.3rem;
}

.glass-nav .navbar-brand i { -webkit-text-fill-color: initial; color: #667eea; }

.glass-nav .nav-link {
    color: #555 !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 10px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.glass-nav .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea !important;
    transform: translateY(-1px);
}

.glass-nav .nav-link i { margin-right: 4px; }

/* Hero */
.hero-section {
    padding: 48px 0 32px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, #667eea22, #764ba222, #667eea22);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content .lead { color: #666; }

/* 分类头部 */
.category-header {
    margin-bottom: 24px;
    padding-left: 4px;
    border-left: 4px solid #667eea;
    padding-left: 16px;
}

.category-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.category-header h2 i { margin-right: 8px; }

.category-header p { font-size: 0.9rem; margin-bottom: 0; }

/* 工具卡片 */
.tool-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 100%;
    overflow: hidden;
}

.tool-card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-4px);
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0;
}

.tool-card-header i {
    font-size: 1.5rem;
    color: #667eea;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.tool-card-header h5 {
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1.05rem;
}

.tool-card-body {
    padding: 16px 24px 24px;
}

/* 表单控件美化 */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e8ecf1;
    transition: var(--transition);
    font-size: 0.9rem;
    padding: 10px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 6px;
}

.form-range::-webkit-slider-thumb {
    background: #667eea;
}

/* 按钮美化 */
.btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 10px 20px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--bg-gradient);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success { background: #10b981; border: none; }
.btn-success:hover { background: #059669; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4); }

.btn-warning { background: #f59e0b; border: none; color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }

.btn-outline-primary { border-color: #667eea; color: #667eea; }
.btn-outline-primary:hover { background: var(--bg-gradient); border-color: transparent; color: #fff; }

.btn-outline-secondary { border-color: #d1d5db; color: #6b7280; }
.btn-outline-secondary:hover { background: #f3f4f6; border-color: #9ca3af; }

/* 结果区域 */
.tool-result {
    background: #f8f9fc;
    border-radius: 12px;
    padding: 16px;
    min-height: 80px;
    transition: var(--transition);
}

.placeholder-text {
    color: #adb5bd;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* 等宽字体 */
.font-mono { font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 0.85rem; }

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-item {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e8ecf1;
    transition: var(--transition);
}

.stat-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

/* UUID 结果 */
#uuidResult .uuid-item {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

#uuidResult .uuid-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.03);
}

#uuidResult .uuid-item .copy-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

#uuidResult .uuid-item .copy-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* 密码生成器 */
#passwordOutput {
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-align: center;
    font-weight: 600;
}

/* 时间戳结果 */
#tsResult .ts-output {
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 8px;
    border: 1px solid #e8ecf1;
}

/* 二维码结果 */
#qrResult img {
    max-width: 200px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin: 12px auto;
    display: block;
}

/* 汇率结果表格 */
.rate-table {
    max-height: 350px;
    overflow-y: auto;
    margin-top: 8px;
}

.rate-table::-webkit-scrollbar { width: 4px; }
.rate-table::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.rate-table::-webkit-scrollbar-track { background: transparent; }

.rate-table table {
    width: 100%;
    font-size: 0.85rem;
}

.rate-table th {
    background: #f0f2f5;
    position: sticky;
    top: 0;
    z-index: 1;
}

.rate-table td, .rate-table th {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f2f5;
}

.rate-table tr:hover { background: rgba(102, 126, 234, 0.03); }

/* IP 查询结果 */
.ip-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ip-info-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #f0f2f5;
}

.ip-info-item .label { font-size: 0.8rem; color: #888; }
.ip-info-item .value { font-size: 0.85rem; font-weight: 600; color: #333; }

/* 网站检测结果 */
.site-status {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
}

.site-status .status-icon { font-size: 2rem; }
.site-status .status-icon.online { color: #10b981; }
.site-status .status-icon.offline { color: #ef4444; }

.site-status .status-body { flex: 1; }
.site-status .status-body .status-title { font-weight: 600; }
.site-status .status-body .status-detail { font-size: 0.85rem; color: #888; }

/* Error message */
.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    padding: 12px;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

/* Back to top */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    display: none;
    z-index: 999;
    background: var(--bg-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#backToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Footer */
footer {
    background: #fff;
    border-top: 1px solid #f0f2f5;
}

/* 响应式 */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .ip-info-grid { grid-template-columns: 1fr; }
    .hero-section { padding: 32px 0 24px; }
    .hero-content h1 { font-size: 1.8rem; }
}

/* 复制成功动画 */
.copy-flash {
    animation: copyFlash 0.6s ease;
}

@keyframes copyFlash {
    0%, 100% { background: transparent; }
    50% { background: rgba(16, 185, 129, 0.15); }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e8ecf1;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
