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

html {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  width: 90%;
  max-width: 960px;
  margin: 0 auto;
}

.site-header {
  background: #FFFFFF;
  padding: 16px 0;
  position: relative;
  z-index: 100;
  color: #47474F;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 40px;
  width: auto;
}

.site-title {
  margin: 0;
  font-size: 24px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333333;
}

.nav {
  display: flex;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-content: flex-start;
}

.nav-list li {
  flex: 0 1 auto;
  min-width: 100px;
}

.nav-list a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.3);
  color: #333333;
  font-size: 16px;
  display: block;
  white-space: nowrap;
  transition: background 0.2s;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav {
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    /* padding: 8px 0; */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }

  .nav.open {
    max-height: 500px;
    transition: max-height 0.3s ease-in;
  }

  .nav-list {
    flex-direction: column;
    gap: 12px;
    padding: 8px 16px;
  }

  .nav-list li {
    width: 100%;
  }

  .nav-list a {
    padding: 12px 16px;
    border-radius: 6px;
    text-align: left;
    color: #333;
    background: none;
  }

  .nav-list a:hover {
    background: rgba(255, 99, 71, 0.1);
  }
}

main {
  flex: 1;
  padding: 40px 0;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h2 {
  font-size: 42px;
  margin-bottom: 16px;
  color: #222;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.tool-card {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  /* 为了绝对定位的链接覆盖 */
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tool-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #333;
}

.tool-card p {
  flex: 1;
  font-size: 14px;
  color: #555;
  margin-bottom: 16px;
}

.tool-card .badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 12px;
  color: white;
}

.badge.new {
  background-color: #6c5ce7;
}

.badge.hot {
  background-color: #ff6b6b;
}

/* 新增：覆盖卡片的链接样式 */
.tool-card a.card-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* 让链接在整个卡片上 */
  text-indent: -9999px;
  /* 隐藏文本（如果有） */
  z-index: 1;
}

.site-footer {
  background: #EEEEEE;
  padding: 20px 0;
}

.footer-inner {
  text-align: center;
  color: #333;
  font-size: 14px;
}

.tools-header {
  text-align: left;
  margin-bottom: 32px;
}

.tools-header .container h2 {
  font-size: 32px;
  color: #222;
  margin-bottom: 8px;
}

.tools-header .container p {
  font-size: 16px;
  color: #666;
}

.header {
  text-align: center;
  padding: 40px 20px 20px;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: #ff8c42;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  margin-right: 8px;
  font-size: 14px;
}

h1 {
  font-size: 28px;
  font-weight: 500;
  color: #333;
  margin: 0;
}

.subtitle {
  font-size: 16px;
  color: #666;
  margin-top: 10px;
}

.converter-card {
  background: linear-gradient(to bottom, #f7f9fd 0%, #ffffff 100%);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 50px 40px;
  width: 100%;
  max-width: 600px;
  margin-bottom: 50px;
  text-align: center;
  margin: 0 auto 50px;
}

.upload-icon {
  width: 120px;
  height: 120px;
  margin: 20px auto 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23B3E5FC' d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm-1 7h5.5L13 3.5V9z'/%3E%3Cpath fill='%2381D4FA' d='M13 3.5V9h5.5L13 3.5z'/%3E%3C/svg%3E") no-repeat center center;
  background-size: contain;
  opacity: 0.7;
}

#fileInput {
  display: none;
}

.choose-files-btn {
  background-color: #4C6FFF;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
  box-shadow: 0 4px 15px rgba(76, 111, 255, 0.4);
  font-weight: 600;
  margin-bottom: 20px;
}

.choose-files-btn:hover {
  background-color: #3a5edb;
}

.convert-btn {
  background-color: #009688;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 150, 136, 0.4);
}

.convert-btn:hover {
  background-color: #00796b;
}

.file-name {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
  word-break: break-all;
}

.drag-text {
  color: #999;
  margin-top: 15px;
  font-size: 14px;
}

/* Hidden File Input */
#pdf-file {
  display: none;
}

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

/* Output Area Styling (Hidden initially for conversion flow) */
.output-container {
  margin-top: 30px;
  text-align: left;
}

#text-output {
  width: 100%;
  min-height: 200px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  resize: vertical;
  font-size: 14px;
  box-sizing: border-box;
  /* Include padding and border in the element's total width and height */
  margin-bottom: 10px;
}

#download {
  background-color: #1ABC9C;
  padding: 10px 20px;
  border-radius: 8px;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

#download:hover {
  background-color: #159f83;
}