:root {
    --primary-color: #2a5c82;
    --secondary-color: #4f8bb7;
    --background: #f8f9fa;
    --sidebar-bg: #f8f9fa;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", system-ui, sans-serif;
  }

  body {
    font-family: "Inter", system-ui, sans-serif;
    margin: 0;
    padding: 20px;
    background: var(--background);
    color: var(--text-primary);
  }
  .main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    height: 72px;
    display: flex;
    justify-content: center; /* 新增：使内容居中 */
  }

  .header-nav-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
  }

  .nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s var(--transition);
  }

  .nav-link:hover {
    color: var(--secondary-color);
  }

  /* 下拉菜单 */
  .dropdown {
    position: relative;
    margin-right: 1px;
  }

  .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 120px;
    z-index: 100;
    font-weight: 500; /* 新增字体加粗效果 */
  }

  .dropdown:hover .dropdown-menu {
    display: block;
  }

  .dropdown-menu a {
    color: #333;
text-decoration: none;
display: block;
padding: 8px 12px;
transition: color 0.2s ease;
}

  .dropdown-menu a:hover {
     background-color: #9f9c9c32;
  }
  .container {
    padding: 20px; /* 上下左右统一20px间距 */
    width: 100%;
    box-sizing: border-box;
  }

  /* 标签页样式 */
  .tabs {
    display: flex;
    margin-top: 60px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
  }
  .tab {
    padding: 12px 20px;
    cursor: pointer;
    background: #ecf0f1;
    margin-right: 5px;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    transition: all 0.2s;
  }
  .tab:hover {
    background: #d6eaf8;
  }
  .tab.active {
    background: #2c3e50;
    color: white;
  }

  /* 内容面板样式 */
  .tab-content {
    display: none;
  }
  .tab-content.active {
    display: block;
  }

  /* 控制面板通用样式 */
  .panel-container {
    display: flex;
    gap: 20px;
  }
  .control-panel {
    width: 500px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  .preview-panel {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    padding: 20px;
  }
  .section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 15px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
  }
  .param-group {
    margin-bottom: 18px;
  }
  label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
  }
  input,
  select,
  textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
  }
  textarea {
    min-height: 80px;
    resize: vertical;
  }
  button {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 15px;
    margin-top: 10px;
    transition: background 0.2s;
  }
  button:hover {
    background: #34495e;
  }
  button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
  }
  #imageResult {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
  }
  #imageResult img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  .upload-preview {
    height: 150px;
    border: 2px dashed #ddd;
    margin-top: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .upload-preview img {
    max-width: 100%;
    max-height: 100%;
  }
  .upload-preview p {
    color: #7f8c8d;
  }
  .status-info {
    margin-top: 15px;
    font-size: 13px;
    color: #7f8c8d;
    text-align: center;
  }
  .progress-bar {
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    width: 0%;
    background: #3498db;
    transition: width 0.3s;
  }

  /* 比较视图样式 */
  .comparison-container {
position: relative;
width: 100%;
height: 100%; /* 关键：必须设置高度 */
overflow: hidden; /* 防止内容溢出 */
}
.comparison-before, 
.comparison-after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: contain; /* 保持图片比例 */
}
.comparison-before {
z-index: 1;
clip-path: inset(0 50% 0 0); /* 初始显示左半部分 */
}
.comparison-slider {
position: absolute;
top: 0;
bottom: 0;
left: 50%;
width: 4px;
background: white;
cursor: ew-resize;
z-index: 2;
transform: translateX(-50%);
}
.comparison-slider::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 30px;
height: 30px;
background: white;
border-radius: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

  /* 特殊控件样式 */
  .strength-control,
  .mask-control {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .strength-control input[type="range"],
  .mask-control input[type="range"] {
    flex: 1;
  }
  .strength-value,
  .mask-value {
    width: 30px;
    text-align: center;
    font-weight: bold;
  }
  .format-options {
    display: flex;
    gap: 10px;
  }
  .format-option {
    flex: 1;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
  }
  .format-option.selected {
    background: #2c3e50;
    color: white;
  }
  .style-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .style-preset {
    font-size: 12px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
  }
  .style-preset.selected {
    background: #2c3e50;
    color: white;
  }
  .direction-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
  }
  .direction-control {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .direction-control input[type="number"] {
    width: 70px;
  }
  .direction-label {
    width: 40px;
    font-weight: bold;
  }
  .upload-group {
    display: flex;
    gap: 10px;
  }
  .upload-container {
    flex: 1;
  }
  .user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }

  .user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
  }
  

  .user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 120px;
    z-index: 100;
  }
.user-dropdown a {
color: #333;
text-decoration: none;
display: block;
padding: 8px 12px;
transition: color 0.2s ease;
}
  .user-menu:hover .user-dropdown {
    display: block;
  }
  .user-dropdown a:hover {
     background-color: #9f9c9c32;
  }

  /* 保持原有登录按钮样式 */
  .authing-login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
  }
  .credit-counter {
display: flex;
align-items: center;
gap: 6px;
margin-right: 20px;
padding: 6px 12px;
background: rgba(255, 215, 0, 0.1);
border-radius: 16px;
font-weight: 600;
color: #ffd700; /* 金色强调 */
}

.credit-counter i {
color: #ffd700;
}

/* 低次数警告 */
.credit-counter.low {
color: #ff6b6b;
animation: pulse 1.5s infinite;
}

@keyframes pulse {
0% { opacity: 1; }
50% { opacity: 0.6; }
100% { opacity: 1; }
}