/* 导入样式模块 */
@import url('css/type-A.css');
@import url('css/type-B.css');
@import url('css/type-C.css');

/* 导入 MiSans 字体 */
@font-face {
  font-family: 'MiSans';
  src: url('fonts/MiSans-Normal.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'MiSans';
  src: url('fonts/MiSans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'MiSans';
  src: url('fonts/MiSans-Semibold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'MiSans', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: #0a0a0a;
  color: #eee;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
}

/* 顶部标题栏 */
.app-header {
  text-align: center;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: none;
  padding: 0;
}

/* 关于按钮 */
.about-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #333;
  border-radius: 8px;
  color: #888;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.about-btn:hover {
  color: #68bbff;
  border-color: #68bbff;
  background: rgba(104, 187, 255, 0.1);
}

/* 标签页 */
.tab-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #888;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #ccc;
}

.tab-btn.active {
  color: #68bbff;
  border-bottom-color: #68bbff;
}

/* 样式卡片隐藏 */
.style-card.hidden {
  display: none;
}

.app-title {
  font-size: 36px;
  color: #68bbff;
  margin-bottom: 8px;
}

.app-subtitle {
  font-size: 16px;
  color: #888;
}

/* 样式图片墙 */
.style-gallery {
  flex: 1;
  max-width: none;
  margin: 0;
  width: 100%;
}

.section-title {
  text-align: center;
  color: #888;
  font-size: 18px;
  margin-bottom: 30px;
}

.style-grid {
  column-count: 3;
  column-gap: 12px;
  padding: 0;
}

.style-card {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.style-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: #68bbff;
}

.style-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.style-preview {
  padding: 0;
  background: transparent;
  position: relative;
}

.frame-container {
  width: 100%;
  position: relative;
}

.frame-container img {
  width: 100%;
  display: block;
}

.photo-footer {
  background: #fff;
  width: 100%;
  position: relative;
}

.frame-container.style-b .photo-footer {
  background: #000;
}

.coming-soon {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 14px;
}

/* 样式名称覆盖标签 */
.style-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  color: #ddd;
  font-size: 13px;
  font-weight: 500;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.style-info {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.style-name {
  color: #eee;
  font-weight: 500;
}

.style-tag {
  color: #68bbff;
  font-size: 12px;
  background: rgba(104, 187, 255, 0.15);
  padding: 4px 8px;
  border-radius: 4px;
}

.app-footer {
  text-align: center;
  padding: 30px 20px;
  color: #555;
}

/* ========== 编辑器页面样式 ========== */

.editor-view {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.editor-view.hidden {
  display: none;
}

/* 主预览区 */
.preview-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16213e;
  padding: 40px;
  padding-right: 120px;
  overflow: hidden;
}

.frame-wrapper img {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  width: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

/* 右侧浮动图标按钮 */
.float-actions {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
}

.float-btn {
  width: 72px;
  height: 72px;
  background: rgba(17, 17, 17, 0.9);
  border: 1px solid #333;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #888;
}

.float-btn:hover {
  background: rgba(104, 187, 255, 0.15);
  border-color: #68bbff;
  color: #68bbff;
  transform: scale(1.05);
}

.float-btn i {
  font-size: 24px;
  margin-bottom: 4px;
}

.float-btn span {
  font-size: 10px;
}

/* 编辑面板 */
.edit-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  background: #111;
  border-left: 1px solid #222;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 100;
}

.edit-panel.visible {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  background: #111;
  z-index: 1;
  gap: 12px;
}

.panel-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 6px;
  color: #888;
  cursor: pointer;
  font-size: 16px;
}

.panel-close:hover {
  border-color: #68bbff;
  color: #68bbff;
}

.panel-title {
  color: #eee;
  font-size: 15px;
  font-weight: 500;
  flex: 1;
}

.btn-export-top {
  background: #68bbff;
  color: #0a0a0a;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-export-top:hover {
  background: #8fcfff;
}

/* 编辑分区 */
.edit-section {
  padding: 16px 20px;
  border-bottom: 1px solid #222;
}

.section-title {
  color: #68bbff;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  font-size: 12px;
}

.control-group {
  margin-bottom: 12px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group > label {
  display: block;
  color: #888;
  font-size: 11px;
  margin-bottom: 6px;
}

/* 颜色预设按钮组 */
.color-preset-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-preset {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid #333;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
}

.color-preset.white {
  background: #ffffff;
  color: #333;
}

.color-preset.black {
  background: #1a1a1a;
  color: #888;
}

.color-preset.active {
  border-color: #68bbff;
  box-shadow: 0 0 0 2px rgba(104, 187, 255, 0.3);
}

.color-preset:hover {
  transform: scale(1.05);
}

.color-input {
  flex: 1;
  height: 36px;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.color-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #222;
  appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #68bbff;
  cursor: pointer;
}

input[type="text"] {
  width: 100%;
  height: 38px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #eee;
  padding: 0 12px;
  font-size: 13px;
}

input[type="text"]:focus {
  outline: none;
  border-color: #68bbff;
}

input[type="text"]::placeholder {
  color: #555;
}

select {
  width: 100%;
  height: 38px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #eee;
  padding: 0 12px;
  font-size: 13px;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: #68bbff;
}

/* 拍摄参数 2x2 网格 */
.params-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.param-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 0 8px;
}

.param-item label {
  color: #888;
  font-size: 11px;
  min-width: 28px;
  margin: 0;
}

.param-item input {
  flex: 1;
  height: 32px;
  background: transparent;
  border: none;
  color: #eee;
  padding: 0;
  margin: 0;
  font-size: 12px;
  min-width: 0;
}

.param-item input:focus {
  outline: none;
  border: none;
}

.param-item input::placeholder {
  color: #555;
}

/* Logo 网格选择器 - 每行6个 */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(6, 40px);
  grid-auto-rows: 40px;
  gap: 6px;
  overflow-y: auto;
  max-height: 200px;
  padding: 6px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: 8px;
}

.logo-grid-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
}

.logo-grid-item img,
.logo-grid-item svg {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-grid-item:hover {
  background: #333;
  border-color: #555;
}

.logo-grid-item.selected {
  border-color: #68bbff;
  background: rgba(104, 187, 255, 0.15);
}

.logo-grid-item svg {
  width: 100%;
  height: 100%;
  color: #888;
}

.logo-grid-item.selected svg {
  color: #fff;
}

/* Logo 预览 */
.logo-preview {
  margin-top: 12px;
  height: 48px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 12px;
  overflow: hidden;
}

/* ========== 边框内容预览样式 ========== */
/* 注意：边框内容样式已移至 css/type-a.css */

.logo-preview svg {
  max-height: 100%;
  max-width: 100%;
}

.logo-preview:empty::before {
  content: '选择厂商后预览';
}

.value-display {
  color: #68bbff;
  font-size: 11px;
  float: right;
}

/* Switch 开关 */
.switch-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch-group label {
  color: #ccc;
  font-size: 12px;
}

.switch {
  width: 40px;
  height: 22px;
  background: #333;
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.switch.active {
  background: #68bbff;
}

.switch::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.switch.active::after {
  transform: translateX(18px);
}

/* 导出按钮 */
.panel-footer {
  padding: 16px 20px;
  position: sticky;
  bottom: 0;
  background: #111;
  border-top: 1px solid #222;
}

.btn-primary {
  width: 100%;
  background: #68bbff;
  color: #0a0a0a;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: #8fcfff;
}

.btn-primary:disabled {
  background: #555;
  cursor: not-allowed;
}

/* 滚动条 */
.edit-panel::-webkit-scrollbar {
  width: 6px;
}

.edit-panel::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* Logo 颜色反转 - 深色背景时将深色 logo 转为白色 */
.logo-invert {
  filter: brightness(0) invert(1);
}

/* ========== 关于模态框 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 16px;
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #222;
}

.modal-title {
  color: #eee;
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  color: #68bbff;
  background: rgba(104, 187, 255, 0.1);
}

.modal-body {
  padding: 20px;
  color: #ccc;
  font-size: 13px;
  line-height: 1.7;
}

.modal-body p {
  margin-bottom: 8px;
}

.modal-body hr {
  border: none;
  border-top: 1px solid #222;
  margin: 12px 0;
}

.modal-body a {
  color: #68bbff;
  text-decoration: none;
}

.modal-body a:hover {
  text-decoration: underline;
}

.modal-body strong {
  color: #eee;
}

.modal-note {
  color: #888;
  font-size: 12px;
  font-style: italic;
}
