/* ---------------------------------------------------
   Global Reset & Base
--------------------------------------------------- */
html, body {
  margin: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #5a8dee, #7f53ac);
}


/* ---------------------------------------------------
   Header
--------------------------------------------------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header .logo {
  font-size: 22px;
  font-weight: 700;
  color: #333;
}

.header nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #333;
  font-size: 15px;
}


/* ---------------------------------------------------
   Hero Section
--------------------------------------------------- */
.hero {
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(135deg, #5a8dee, #7f53ac);
  color: white;
}

.hero .btn {
  margin-top: 20px;
  display: inline-block;
  padding: 12px 25px;
  background: white;
  color: #333;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
}


/* ---------------------------------------------------
   Tools Section
--------------------------------------------------- */
.tools-section {
  padding: 40px 20px;
  max-width: 1100px;
  margin: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 15px;
}

.tool-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: #333;
  font-size: 15px;
  font-weight: 500;
}

.tool-card:hover {
  background: #eef2ff;
}


/* ---------------------------------------------------
   Footer
--------------------------------------------------- */
.footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  color: #777;
}


/* ---------------------------------------------------
   Main Tool Layout (Page Layout + Ads)
--------------------------------------------------- */
.container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1400px; /* 最大容器宽度 */
  margin: 0 auto;
  padding: 2vw;
  gap: 20px; /* 广告和中间内容间距 */
  box-sizing: border-box;
}

/* 中间内容固定宽度 */
.page-layout {
  width: 50vw;       /* 固定宽度 */
  background: white;
  border-radius: 16px;
  padding: 3vw;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  box-sizing: border-box;
  margin-left: 3vw;
  margin-right: 3vw;
}

/* 广告自适应宽度 */
.side-ad {
  flex: 1 1 16vw; /* 可增长、可收缩、基础宽度200px */
  min-width: 16vw; /* 最小宽度，保证不太小 */
  max-width: 20vw; /* 最大宽度限制 */
  background: #eee;
  border-radius: 16px;
  box-sizing: border-box;
}

/* 小屏幕隐藏广告 */
@media (max-width: 1024px) {
  .side-ad {
    display: none;
  }
  .container {
    justify-content: center;
  }
  .page-layout {
    width: 85vw; 
  }
}

.ad-box {
  margin: 20px 0;
  text-align: center;
}


/* ---------------------------------------------------
   Titles
--------------------------------------------------- */
h1 {
  margin-bottom: 20px;
  color: #111;
}

h2 {
  margin-top: 40px;
  margin-bottom: 20px;
  color: #111;
  font-size: 22px;
}


/* ---------------------------------------------------
   Upload Area
--------------------------------------------------- */
#uploadArea {
  border: 3px dashed #5a8dee;
  border-radius: 16px;
  background: #f0f4ff;
  margin-bottom: 20px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  min-height: 350px;
  display: flex;
  flex-direction: column;   /* 纵向排列 */
  justify-content: center;  /* 垂直居中 */
  align-items: center;       /* 水平居中 */
  text-align: center;
  position: relative;       /* 允许未来 absolute 使用 */
}

.plus-icon {
  font-size: 60px;
  color: #5a8dee;
  pointer-events: none;
  margin-bottom: 12px;       /* 图标与文字间距 */
}

#uploadText {
  font-size: 14px;
  color: #555;
}


#uploadArea.dragover {
  background: #d0e0ff;
  border-color: #3f6ad8;
}

#uploadArea input[type="file"] {
  display: none;
}

/* ---------------------------------------------------
   Card + Preview
--------------------------------------------------- */
.card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card h2 {
  font-size: 20px;
  margin-bottom: 12px;
  font-weight: bold;
}

.card img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 12px;
  object-fit: contain;
}

.download-btn {
  display: inline-block;
  padding: 8px 16px;
  background: #5a8dee;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}


/* ---------------------------------------------------
   Form Inputs & Buttons
--------------------------------------------------- */
.row-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px
}

input,
select {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box; 
}

button {
  padding: 12px 24px;
  border-radius: 8px;
  background: #5a8dee;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

button:hover {
  background: #3f6ad8;
}


/* ---------------------------------------------------
   Output & Preview
--------------------------------------------------- */
.output-box {
  border: 1px solid #ccc;
  background: #fff;
  padding: 12px;
  border-radius: 6px;
  min-height: 200px;
  white-space: pre-wrap;
  color: black;
  text-align: left;
  word-break: break-all;
  overflow: auto;
}

.btn-row {
    display: flex;
    gap: 12px;
    margin: 12px;
    flex-wrap: wrap;
}

textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #bbb;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box; 
}

label {
  color: black;
  white-space: nowrap;
}

.flex-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.format-container {
  margin-bottom:20px;
  display:flex; 
  justify-content:center;
  align-items:center; 
  gap:10px; 
  font-size:14px;
}

.tool-description {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin-top: 25px;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}