* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f5f7fa; color: #1a1a1a; min-height: 100vh; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }

/* 左侧边栏 */
.sidebar { width: 240px; background: #fff; border-right: 1px solid #eef0f4; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; }
.sidebar-brand { padding: 24px 20px; font-size: 18px; font-weight: 700; color: #2B579A; }
.sidebar-nav { flex: 1; padding: 0 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; color: #555; text-decoration: none; font-size: 14px; margin-bottom: 4px; transition: all 0.15s; }
.nav-item:hover { background: #f0f4fa; color: #2B579A; }
.nav-item.active { background: #2B579A; color: #fff; }
.nav-icon { font-size: 16px; }

.sidebar-footer { padding: 16px; }
.vip-card { background: linear-gradient(135deg, #f0f4ff, #e8eeff); border-radius: 12px; padding: 20px 16px; }
.vip-title { font-size: 13px; font-weight: 600; color: #2B579A; margin-bottom: 6px; }
.vip-desc { font-size: 12px; color: #666; margin-bottom: 14px; }
.vip-btn { width: 100%; height: 36px; background: #2B579A; color: #fff; border: none; border-radius: 18px; font-size: 13px; cursor: pointer; }
.vip-btn:hover { background: #1e4078; }

/* 右侧主区域 */
.main-area { flex: 1; margin-left: 240px; display: flex; flex-direction: column; }

/* 顶部栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; background: #fff; border-bottom: 1px solid #eef0f4; position: sticky; top: 0; z-index: 40; }
.search-box { display: flex; align-items: center; background: #f5f7fa; border-radius: 8px; padding: 0 16px; height: 40px; width: 400px; border: 1px solid #e8e8e8; }
.search-icon { margin-right: 8px; color: #999; }
.search-box input { border: none; outline: none; background: none; flex: 1; font-size: 14px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.remain-count { font-size: 13px; color: #2B579A; background: #e8f0fb; padding: 4px 12px; border-radius: 12px; font-weight: 500; }
.user-status { color: #52c41a; font-size: 10px; }
.user-status.offline { color: #ccc; }
.user-name { font-size: 14px; color: #333; }
.login-btn { background: #2B579A; color: #fff; border: none; padding: 6px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.login-btn:hover { background: #1e4078; }

/* 内容区 */
.content { padding: 32px; flex: 1; }
.welcome { margin-bottom: 36px; }
.welcome h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; color: #1a1a1a; }
.welcome p { font-size: 15px; color: #888; }

/* 工具卡片网格 */
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.tool-card { background: #fff; border-radius: 14px; padding: 28px 24px; cursor: pointer; transition: all 0.2s; border: 1px solid #f0f0f0; display: flex; gap: 20px; align-items: flex-start; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); border-color: #ddd; }
.tool-card-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.icon-blue { background: #e8f4fd; }
.icon-red { background: #fde8e8; }
.icon-orange { background: #fef3e2; }
.icon-green { background: #e6f7ed; }
.icon-purple { background: #f0e8fd; }
.tool-card-body { flex: 1; }
.tool-card-body h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: #1a1a1a; }
.tool-card-body p { font-size: 13px; color: #888; line-height: 1.6; margin-bottom: 12px; }
.tool-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; color: #666; background: #f5f7fa; padding: 3px 10px; border-radius: 4px; }

/* 登录弹窗 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 200; }

.login-page { display: flex; width: 820px; max-width: 95%; min-height: 480px; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }

/* 左侧品牌区 */
.login-left { width: 340px; background: linear-gradient(135deg, #1e3a6e 0%, #2B579A 50%, #1a4080 100%); color: #fff; padding: 48px 32px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-left::before { content: ''; position: absolute; top: -50%; right: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; position: relative; }
.login-brand-icon { font-size: 28px; }
.login-brand-name { font-size: 20px; font-weight: 700; }
.login-slogan { font-size: 15px; line-height: 1.8; opacity: 0.9; margin-bottom: 36px; position: relative; }
.login-features { display: flex; gap: 16px; position: relative; }
.login-feature { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.1); border-radius: 10px; padding: 14px 16px; flex: 1; }
.login-feature-icon { font-size: 22px; }
.login-feature-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.login-feature-desc { font-size: 11px; opacity: 0.7; }

/* 右侧表单区 */
.login-right { flex: 1; background: #fff; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.login-close { position: absolute; top: 16px; right: 20px; font-size: 28px; color: #999; cursor: pointer; line-height: 1; }
.login-close:hover { color: #333; }
.login-title { font-size: 24px; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: #999; margin-bottom: 32px; }

.login-form { }
.login-input-group { display: flex; align-items: center; border: 1px solid #e0e0e0; border-radius: 10px; padding: 0 16px; height: 48px; margin-bottom: 16px; transition: border-color 0.2s; }
.login-input-group:focus-within { border-color: #2B579A; }
.login-input-icon { font-size: 18px; margin-right: 12px; }
.login-input-group input { border: none; outline: none; flex: 1; font-size: 15px; height: 100%; }

.login-agree { display: flex; align-items: flex-start; gap: 8px; margin: 20px 0; }
.login-agree input { margin-top: 3px; }
.login-agree label { font-size: 12px; color: #888; line-height: 1.5; cursor: pointer; }

.login-submit-btn { width: 100%; height: 48px; background: #2B579A; color: #fff; border: none; border-radius: 24px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.login-submit-btn:hover { background: #1e4078; }

.login-tip-text { text-align: center; font-size: 12px; color: #bbb; margin-top: 16px; }

@media (max-width: 768px) {
  .login-page { flex-direction: column; width: 90%; min-height: auto; }
  .login-left { width: 100%; padding: 32px 24px; }
  .login-right { padding: 32px 24px; }
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .search-box { width: 200px; }
  .tool-cards { grid-template-columns: 1fr; }
}


/* 页面标题 */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.page-header p { font-size: 14px; color: #888; }

/* 面包屑 */
.breadcrumb { margin-bottom: 16px; font-size: 13px; }
.crumb-link { color: #2B579A; cursor: pointer; }
.crumb-link:hover { text-decoration: underline; }
.crumb-sep { color: #ccc; margin: 0 8px; }
.crumb-current { color: #666; }

/* 子菜单网格 */
.sub-menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.sub-menu-card { background: #fff; border-radius: 10px; padding: 24px 16px; text-align: center; cursor: pointer; transition: all 0.15s; border: 1px solid #f0f0f0; }
.sub-menu-card:hover { border-color: #2B579A; box-shadow: 0 4px 12px rgba(43,87,154,0.1); }
.sub-icon { display: block; font-size: 28px; margin-bottom: 8px; }

/* 工具工作区 */
.tool-workspace { max-width: 700px; margin: 0 auto; }
.upload-zone { border: 2px dashed #d0d8e8; border-radius: 12px; padding: 48px 24px; text-align: center; background: #fafbfd; cursor: pointer; transition: all 0.2s; }
.upload-zone:hover, .upload-zone.dragover { border-color: #2B579A; background: #f0f4fa; }
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-zone p { font-size: 14px; color: #666; }
.upload-link { color: #2B579A; font-weight: 500; cursor: pointer; }

/* 工具选项 */
#tool-options { margin-top: 20px; display: none; }
.file-list-header { font-size: 13px; color: #888; margin-bottom: 8px; }
.file-list { margin-bottom: 16px; }
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #fff; border-radius: 8px; border: 1px solid #f0f0f0; margin-bottom: 8px; font-size: 13px; }
.file-size { color: #999; font-size: 12px; }
.option-group { margin-bottom: 16px; }
.option-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.option-group input, .option-group select { width: 100%; height: 40px; border: 1px solid #ddd; border-radius: 8px; padding: 0 12px; font-size: 14px; }
.option-group input:focus, .option-group select:focus { outline: none; border-color: #2B579A; }
.btn-convert { width: 100%; height: 44px; background: #2B579A; color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; margin-top: 8px; }
.btn-convert:hover { background: #1e4078; }
.btn-small { background: #2B579A; color: #fff; border: none; padding: 4px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; }

/* 结果区 */
.tool-result { margin-top: 16px; }
.progress-msg { color: #2B579A; font-size: 14px; padding: 12px; background: #f0f4fa; border-radius: 8px; }
.result-msg { padding: 12px; border-radius: 8px; font-size: 14px; }
.result-msg.success { background: #e6f7ed; color: #1a8a4a; }
.result-msg.error { background: #fde8e8; color: #d32; }
.result-title { font-size: 14px; font-weight: 500; margin-bottom: 12px; }

/* 历史表格 */
.history-table { background: #fff; border-radius: 10px; overflow: hidden; }
.history-table table { width: 100%; border-collapse: collapse; }
.history-table th { text-align: left; padding: 12px 16px; font-size: 13px; color: #888; background: #f9fafb; border-bottom: 1px solid #f0f0f0; }
.history-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid #f5f5f5; }
.status-ok { color: #52c41a; font-weight: 500; }
.status-fail { color: #ff4d4f; font-weight: 500; }

/* 个人中心 */
.profile-card { background: #fff; border-radius: 10px; padding: 24px; max-width: 500px; }
.profile-row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.profile-row:last-child { border-bottom: none; }
.profile-label { color: #888; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 0; color: #999; }

/* 图片转换结果 */
.img-result-grid { display: flex; flex-direction: column; gap: 12px; }
.img-result-item { display: flex; align-items: center; gap: 16px; background: #fff; border-radius: 10px; padding: 12px 16px; border: 1px solid #f0f0f0; }
.img-preview { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.img-result-info { flex: 1; }
.img-result-name { display: block; font-size: 13px; font-weight: 500; color: #333; margin-bottom: 4px; }
.img-result-size { font-size: 12px; color: #999; }
.btn-download { background: #2B579A; color: #fff; padding: 6px 16px; border-radius: 6px; font-size: 13px; text-decoration: none; flex-shrink: 0; }
.btn-download:hover { background: #1e4078; }


/* 数据转换工具 */
.data-convert-area { display: flex; gap: 16px; align-items: stretch; }
.data-col { flex: 1; display: flex; flex-direction: column; }
.data-label { font-size: 13px; font-weight: 500; color: #666; margin-bottom: 8px; }
.data-textarea { flex: 1; min-height: 300px; border: 1px solid #ddd; border-radius: 8px; padding: 12px; font-family: 'Courier New', monospace; font-size: 13px; resize: vertical; }
.data-textarea:focus { outline: none; border-color: #2B579A; }
.data-actions { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 0 8px; }
.btn-convert-sm { background: #2B579A; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.btn-convert-sm:hover { background: #1e4078; }
.btn-convert-sm.reverse { background: #52c41a; }
.btn-convert-sm.reverse:hover { background: #3da10e; }

@media (max-width: 768px) {
  .data-convert-area { flex-direction: column; }
  .data-actions { flex-direction: row; justify-content: center; }
}


/* PDF页面缩略图预览 */
.pdf-thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin: 16px 0; }
.pdf-thumb-item { position: relative; background: #fff; border: 2px solid #e8e8e8; border-radius: 8px; padding: 8px; cursor: default; transition: all 0.15s; text-align: center; }
.pdf-thumb-item:hover { border-color: #b0c4e8; }
.pdf-thumb-item.selected { border-color: #2B579A; background: #f0f4fa; }
.pdf-thumb-item.selected .pdf-thumb-check { background: #2B579A; border-color: #2B579A; }
.pdf-thumb-item.selected .pdf-thumb-check::after { content: '✓'; color: #fff; font-size: 11px; position: absolute; top: 1px; left: 4px; }
.pdf-thumb-img { width: 100%; height: auto; border-radius: 4px; display: block; cursor: zoom-in; }
.pdf-thumb-label { font-size: 11px; color: #888; margin-top: 4px; }
.pdf-thumb-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border: 2px solid #ccc; border-radius: 50%; cursor: pointer; background: #fff; transition: all 0.15s; z-index: 2; }
.pdf-thumb-check:hover { border-color: #2B579A; }
.pdf-thumb-zoom { display: none; }

/* 放大预览弹窗 */
.pdf-lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 300; display: flex; align-items: center; justify-content: center; }
.pdf-lightbox img { max-width: 80%; max-height: 80%; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.pdf-lightbox-close { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 36px; cursor: pointer; z-index: 10; }
.pdf-lightbox-label { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 60px; cursor: pointer; user-select: none; padding: 20px; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { color: #2B579A; }
.lightbox-select-btn { position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(43,87,154,0.8); padding: 8px 20px; border-radius: 20px; font-size: 13px; cursor: pointer; }
.lightbox-select-btn:hover { background: #2B579A; }


/* 文件结果列表 */
.file-result-list { display: flex; flex-direction: column; gap: 10px; }
.file-result-item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 8px; padding: 12px 16px; border: 1px solid #f0f0f0; }
.file-result-icon { font-size: 20px; flex-shrink: 0; }
.file-result-name { flex: 1; font-size: 13px; font-weight: 500; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-result-size { font-size: 12px; color: #999; flex-shrink: 0; margin-right: 8px; }
