/* -------------------------------------------------------------------------- */
/* 全局样式 */
/* -------------------------------------------------------------------------- */

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
}

img {
    max-width: 100%;
    height: auto;
}

/* -------------------------------------------------------------------------- */
/* 头部和导航栏 */
/* -------------------------------------------------------------------------- */

header {
    background: rgba(255, 255, 255, 0.9);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 2rem;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center; /* 垂直居中 */
}

nav ul li:not(.auth-menu) {
    display: inline-flex; /* 统一使用flex布局 */
    align-items: center;
    height: 100%;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
    padding: 0.8rem 0.5rem;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

nav a:hover {
    color: #007bff;
}

/* 登录按钮优化 */
.auth-menu {
    margin-left: auto; /* 右对齐 */
    padding-left: 0.8rem;
    display: inline-flex; /* 保持布局一致 */
    align-items: center;
    height: 100%;
}

.auth-button {
    background: #f5f5f5;
    color: #666 !important;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    display: inline-flex;
    align-items: center;
}

.auth-button:hover {
    background: #e0e0e0;
    color: #444 !important;
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.menu-icon {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
}

.menu-icon .bar {
    width: 100%;
    height: 3px;
    background-color: #333;
    transition: 0.3s;
}

/* -------------------------------------------------------------------------- */
/* Logo 样式 */
/* -------------------------------------------------------------------------- */

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    text-decoration: none;
    color: inherit;
}  

.logo-part1 {
    font-family: 'Arial Rounded MT Bold', sans-serif;
    font-size: 1.8rem;
    color: #4a90e2;
    font-weight: bold;
    margin-right: 5px;
    white-space: nowrap;
}

.logo-part2 {
    font-family: sans-serif;
    font-size: 1.2rem;
    color: #81c784;
    white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* 主要内容区域 */
/* -------------------------------------------------------------------------- */

.hero {
    background: linear-gradient(to bottom, #e0f7fa, #b2ebf2);
    text-align: center;
    padding: 1rem 1rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.announcement {
    background-color: #ffe0b2;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.section-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.7rem 2rem
}

.user-section-content {
    max-width: 800px;
    margin: 0 auto;
}
/*     ;-------------------------------------------------------------------------- */
/* 图片展示区 */
/* -------------------------------------------------------------------------- */

.image-slider {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.image-slider img,
.image-grid img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.image-slider img {
    width: 30%;
    margin-bottom: 1rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.image-grid img {
    display: block;
    border-radius: 5px;
}

/* -------------------------------------------------------------------------- */
/* 示例展示区 */
/* -------------------------------------------------------------------------- */

.examples-section {
    background-color: #f0f8ff;
    padding: 1rem 2rem;
    text-align: center;
}

.examples-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #007bff;
}

.examples-section p {
    line-height: 1.7;
    margin-bottom: 2rem;
    color: #555;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.example-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.example-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.example-item img:hover {
    transform: scale(1.05);
}

.example-item p {
    color: #666;
    font-size: 1rem;
}

/* -------------------------------------------------------------------------- */
/* 常规内容区 */
/* -------------------------------------------------------------------------- */

.generator-section,
.community-section,
.tutorial-section,
.about-section,
.contact-section,
.faq-section {
    background-color: #f9f9f9;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.faq-section {
    background-color: #f0f8ff;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 .5rem;
}

.faq-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

.faq-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.faq-item p {
    color: #555;
    line-height: 1.6;
}

/* -------------------------------------------------------------------------- */
/* 底部样式 */
/* -------------------------------------------------------------------------- */

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.social-links a {
    color: white;
    margin: 0 1rem;
    text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* 登录表单样式 */
/* -------------------------------------------------------------------------- */

.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.google-login {
    background: #4285f4;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.google-login img {
    width: 20px;
    height: 20px;
}

/* -------------------------------------------------------------------------- */
/* 个人资料页样式 */
/* -------------------------------------------------------------------------- */

.profile-content {
    max-width: 800px;
}

.profile-header {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.points-balance {
    font-size: 1.8rem;
    margin: 1.5rem 0;
    color: #4a90e2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.points-icon {
    font-size: 2rem;
}

.points-history {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-list {
    margin-top: 1.5rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.history-meta {
    flex: 2;
}

.history-date {
    display: block;
    color: #666;
    font-size: 0.9rem;
}

.history-action {
    color: #333;
    font-weight: 500;
}

.history-points {
    flex: 1;
    text-align: right;
    font-weight: bold;
}

.history-points.positive {
    color: #81c784;
}

.history-points.negative {
    color: #e57373;
}

.no-history {
    text-align: center;
    color: #666;
    padding: 2rem;
}

/* -------------------------------------------------------------------------- */
/* CTA 按钮样式 */
/* -------------------------------------------------------------------------- */

.cta-button {
    display: inline-block;
    background-color: #007bff;
    color: white !important;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0.5rem;
    text-align: center;
}

button.cta-button,
input[type="submit"].cta-button,
input[type="button"].cta-button {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cta-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cta-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

.cta-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* -------------------------------------------------------------------------- */
/* 支付页面样式 */
/* -------------------------------------------------------------------------- */

.topup-form {
    max-width: 800px;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.amount-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.amount-option {
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-option:hover {
    border-color: #4a90e2;
    background: #f8fbff;
}

.amount-option.active {
    border-color: #4a90e2;
    background: #e3f2fd;
}

.payment-methods {
    margin: 2rem 0;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.payment-method input[type="radio"] {
    margin-right: 1rem;
}

.payment-logo {
    width: 50px;
    margin-right: 1rem;
}

/* -------------------------------------------------------------------------- */
/* 积分明细页样式 */
/* -------------------------------------------------------------------------- */

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
}

.total-points {
    font-size: 1.4rem;
    color: #4a90e2;
    font-weight: bold;
}

.cta-button.mini {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.history-table {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr;
    
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 2px solid #eee;
    font-weight: bold;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.table-row:hover {
    background: #f8fbff;
}

.table-row.earned .col-points {
    color: #81c784;
}

.table-row.spent .col-points {
    color: #e57373;
}

.col-date {
    padding: 0 1rem;
}

.col-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.arrow {
    font-size: 1.2em;
    opacity: 0.8;
}

.empty-state {
    text-align: center;
    padding: 4rem;
    color: #666;
}

.empty-state img {
    width: 200px;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background: #f0f8ff;
    color: #4a90e2;
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background: #4a90e2;
    color: white;
}

.page-link.active {
    background: #4a90e2;
    color: white;
}


/* ================= 核心容器 ================= */
.img-processor-container {
  --primary-color: #4A90E2;
  --hover-color: #357ABD;
  --border-color: #E0E0E0;
  --radius-lg: 12px;
  --radius-sm: 6px;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 15px;
  box-sizing: border-box;
}

/* ================= 上传区域 ================= */
.img-uploader-box {
  position: relative;
  width: 100%;
  margin-bottom: 2rem;
}

.img-dropzone {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  background: rgba(248, 249, 255, 0.6);
  backdrop-filter: blur(4px);
  transition: 
    var(--transition),
    height 0.3s ease,
    width 0.3s ease;
  cursor: pointer;
  min-height: 120px;
  max-height: 280px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}

.img-dropzone:hover {
  border-color: var(--primary-color);
  background: rgba(245, 248, 255, 0.8);
}

.upload-icon {
  width: 72px;
  height: 72px;
  fill: var(--primary-color);
  opacity: 0.8;
  transition: var(--transition);
}

.upload-instruction {
  color: #666;
  font-size: 1.1rem;
  margin-top: 0.8rem;
  transition: var(--transition);
}

/* ================= 文件输入 ================= */
.img-file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  top: 0;
  left: 0;
  cursor: pointer;
  z-index: 3;
}

/* ================= 图片预览 ================= */
.upload-preview {
  pointer-events: none;
 /* position: absolute;*/
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.upload-preview.active {
  display: block;
}

.upload-preview.processing::after {
  content: 'Processing...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.9);
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 2;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

/* ================= 处理按钮 ================= */
.process-btn {
  display: block;
  width: 200px;
  margin: 1.5rem auto 0;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.9rem 2.8rem;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  cursor: pointer;
  transition: 
    background-color var(--transition),
    transform var(--transition),
    opacity 0.2s ease;
  position: relative;
  z-index: 2;
  box-shadow: 0 3px 12px rgba(74, 144, 226, 0.25);
  text-align: center;
}

.process-btn:hover:not([disabled]) {
  background: var(--hover-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.35);
}

.process-btn[disabled] {
  opacity: 0.7 !important;
  cursor: not-allowed;
  transform: none !important;
}

/* ================= 结果面板 ================= */
.result-panel {
  display: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: 
    opacity 0.4s ease,
    transform 0.4s ease;
}

.result-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.result-image-box {
  position: relative;
  min-height: 400px;
  background: #fcfcfc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1.5rem;
  animation: panelAppear 0.6s ease;
}

@keyframes panelAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= 处理结果 ================= */
.processed-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: none;
  animation: fadeInScale 0.6s ease;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ================= 操作按钮 ================= */
.result-actions {
  text-align: center;
  width: 100%;
  margin-top: auto;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-color);
  color: white !important;
  padding: 0.8rem 2.2rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.download-btn:hover {
  background: var(--hover-color);
  transform: translateY(-2px);
}
/* -------------------------------------------------------------------------- */
/* 响应式布局 */
/* -------------------------------------------------------------------------- */

@media (max-width: 768px) {

    nav {
        padding: 0.8rem .5rem;
    }

    .menu-icon {
        display: flex;
    }

    nav ul {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 280px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        /*box-shadow: -8px 0 24px rgba(0,0,0,0.12);
        padding: 80px 0 30px;
        */
        box-shadow: -0px 0 0px rgba(0,0,0,0.12);
        flex-direction: column;

        padding: 5px 0 10px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0;
        z-index: 999;
    }

    nav ul.active {
        right: 0;
    }
    
    nav ul li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.08);
    }

    nav ul li a {
        width: 100%;
        font-size: 1.05rem;
        color: #444;
        display: flex;
        align-items: center;
        transition: all 0.3s ease;
    }

    nav ul li a:hover {
        background: rgba(0,123,255,0.05);
        padding-left: 2.5rem;
        color: #007bff;
    }

    nav ul li:not(.auth-menu) {
      display: inline-flex; /* 统一使用flex布局 */
       align-items: center;
    }
    
    .auth-menu {
        margin: 5px 0 0;
        padding: 1rem;
        width: 80%;
    }

    .auth-menu .auth-button {
        width: 100%;
        margin: 0;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 12px;
        background: rgba(0,123,255,0.08);
        color: #007bff !important;
        border: none;
        justify-content: center;
    }

    .auth-menu .auth-button:hover {
        background: rgba(0,123,255,0.15);
    }

    .menu-icon.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
        background: #333;
    }

    .menu-icon.active .bar:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }

    .menu-icon.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        background: #333;
    }

    /* 增加点击关闭区域 */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.3);
        backdrop-filter: blur(4px);
        z-index: 998;
        display: none;
    }

    .menu-overlay.active {
        display: block;
    }
  
  .logo-part1 {
    font-size: 1.4rem;
  }
  
  .logo-part2 {
    font-size: 0.9rem;
  }
  
  .img-processor-container {
    padding: 0 10px;
  }
  
  .img-dropzone {
    min-height: 100px;
    padding: 1rem;
  }

  .process-btn {
    max-width: 100%;
    padding: 1.1rem !important;
    font-size: 1rem;
  }

  .result-image-box {
    min-height: 300px;
    padding: 1rem;
  }
}
