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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== 顶层导航栏 ===== */
.top-header {
  background: linear-gradient(135deg, #1a2b4c 0%, #2a3f6e 100%);
  color: white;
  padding: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 500;
}

.header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
}

.header-brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}

.main-nav { display: flex; gap: 0; height: 100%; }

.main-nav-item {
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  border-bottom: 3px solid transparent;
  transition: all 0.25s;
  user-select: none;
  white-space: nowrap;
}

.main-nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.main-nav-item.active { color: #fff; border-bottom-color: #4fc3f7; background: rgba(255,255,255,0.08); }

/* ===== 主容器 ===== */
.main-container { flex: 1; max-width: 1000px; margin: 0 auto; width: 100%; padding: 20px; }

/* ===== 工具面板 ===== */
.tool-panel { display: none; }
.tool-panel.active { display: block; }

/* ===== 工具说明区 ===== */
.tool-intro {
  background: linear-gradient(135deg, #e8f0fe 0%, #f0f4ff 100%);
  border-left: 4px solid #1a2b4c;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.tool-intro h3 { color: #1a2b4c; font-size: 16px; margin-bottom: 8px; }
.tool-intro p { color: #555; font-size: 13px; margin-bottom: 4px; line-height: 1.7; }
.tool-intro .highlight { color: #1a2b4c; font-weight: 600; }

/* ===== 子Tab样式 ===== */
.sub-tab-wrapper { margin-bottom: 20px; }
.sub-tab-container {
  display: flex;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  width: fit-content;
}

.sub-tab {
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  color: #666;
  user-select: none;
  text-align: center;
  min-width: 100px;
}

.sub-tab:hover { background: #f5f5f5; }
.sub-tab.active { background: #1a2b4c; color: #fff; }

/* ===== 子内容区 ===== */
.sub-content { display: none; }
.sub-content.active { display: block; }

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  padding: 24px;
  margin-bottom: 16px;
}

.card h2 { color: #1a2b4c; font-size: 18px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid #f0f0f0; }

/* ===== 图片预览区（像素迷阵） ===== */
.image-preview { margin: 16px auto; text-align: center; }
.preview-img { max-width: 100%; max-height: 280px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }

.image-placeholder {
  margin: 16px auto; width: 100%; height: 240px; border-radius: 10px;
  border: 2px dashed #ccc; display: flex; flex-direction: column;
  justify-content: center; align-items: center; background: #fafafa;
  cursor: pointer; transition: all 0.3s;
}

.image-placeholder:hover { border-color: #1a2b4c; background: #f0f7ff; }
.placeholder-icon { font-size: 40px; color: #ccc; margin-bottom: 8px; }
.placeholder-text { font-size: 14px; color: #999; }

/* ===== 标题区（像素迷阵） ===== */
.title-container { text-align: center; margin: 12px 0; }
.title-container .main-title { font-size: 22px; color: #1a2b4c; margin-bottom: 4px; }
.title-container .sub-title { font-size: 13px; color: #666; }

/* ===== 按钮样式 ===== */
.btn {
  display: inline-block; padding: 12px 24px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s;
}

.btn-primary { background: #1a2b4c; color: #fff; }
.btn-primary:hover { background: #0f1a2e; }
.btn-primary:disabled { background: #a0b4d0; cursor: not-allowed; }

.btn-action { background: #00aaff; color: #fff; }
.btn-action:hover { background: #0099ee; }
.btn-action:disabled { background: #a0cfff; cursor: not-allowed; }

.btn-full { display: block; width: 100%; text-align: center; }

.btn-upload { background: #1a2b4c; color: #fff; display: block; width: 100%; text-align: center; padding: 14px; border-radius: 10px; font-size: 15px; cursor: pointer; border: none; transition: background 0.3s; }
.btn-upload:hover { background: #0f1a2e; }

/* ===== 表单样式 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: #333; }

input[type="file"] { display: block; width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }
input[type="password"] { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 14px; transition: border-color 0.3s; }
input[type="password"]:focus { outline: none; border-color: #1a2b4c; }

input[type="checkbox"] { margin-right: 8px; }

.password-fields { margin-top: 10px; padding: 14px; background: #f9f9f9; border-radius: 8px; }
.password-fields input { margin-bottom: 8px; }

/* ===== 预览区（隐写工具） ===== */
.preview-container { margin-top: 12px; text-align: center; }
.preview-container img { max-width: 100%; max-height: 260px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.file-info { margin-top: 8px; padding: 10px; background: #f9f9f9; border-radius: 8px; font-size: 13px; }

/* ===== 状态消息 ===== */
.status-message { margin-top: 12px; padding: 10px 14px; border-radius: 8px; text-align: center; font-size: 14px; }
.status-message.success { background: #d4edda; color: #155724; }
.status-message.error { background: #f8d7da; color: #721c24; }
.status-message.info { background: #d1ecf1; color: #0c5460; }

/* ===== 结果区（隐写工具） ===== */
.result-container { margin-top: 16px; text-align: center; }
.result-container img, .result-container video { max-width: 100%; max-height: 360px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }

.download-btn {
  display: inline-block; margin-top: 12px; padding: 10px 22px;
  background: #28a745; color: #fff; text-decoration: none;
  border-radius: 8px; font-weight: 600; font-size: 14px; transition: background 0.3s;
  border: none; cursor: pointer;
}

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

/* ===== 结果弹窗（像素迷阵） ===== */
.result-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; justify-content: center; align-items: center; z-index: 1000;
}

.modal-mask {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative; background: #fff; border-radius: 12px;
  width: 90%; max-width: 500px; max-height: 85%; overflow: auto;
  z-index: 1001; box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; text-align: center; }
.modal-header h3 { font-size: 18px; color: #1a2b4c; }
.modal-body { padding: 16px; text-align: center; }
.result-img { max-width: 100%; max-height: 360px; border-radius: 10px; }
.modal-footer { padding: 16px; display: flex; justify-content: center; gap: 12px; border-top: 1px solid #eee; }

.modal-btn {
  padding: 10px 24px; border: none; border-radius: 6px; font-size: 14px;
  font-weight: 500; cursor: pointer; transition: background 0.3s;
  background: #1a2b4c; color: #fff;
}

.modal-btn:hover { background: #0f1a2e; }
.modal-btn.secondary { background: #6c757d; }
.modal-btn.secondary:hover { background: #545b62; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 12px 24px;
  border-radius: 8px; font-size: 14px; z-index: 2000; display: none;
  pointer-events: none;
}

/* ===== Loading ===== */
.loading {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.85); display: flex;
  flex-direction: column; justify-content: center; align-items: center; z-index: 3000;
}

.loading-spinner {
  width: 48px; height: 48px; border: 5px solid #f0f0f0;
  border-top: 5px solid #1a2b4c; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text { margin-top: 14px; font-size: 15px; color: #1a2b4c; font-weight: 500; }

/* ===== 页脚 ===== */
.footer { text-align: center; padding: 16px; color: #999; font-size: 12px; border-top: 1px solid #eee; margin-top: auto; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 10px; gap: 8px; }
  .main-nav { width: 100%; justify-content: center; }
  .main-nav-item { padding: 8px 20px; height: auto; font-size: 14px; }
  .main-container { padding: 12px; }
  .sub-tab-container { width: 100%; }
  .sub-tab { flex: 1; padding: 10px; font-size: 13px; min-width: auto; }
}
