﻿/* ============================================================
   图喵工具 - 全局样式
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --bg: #f8fafc;
  --card: #fff;
  --text: #1e293b;
  --text2: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Header */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.95);
}
header .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 24px;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo .icon { font-size: 28px; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all .2s;
  font-weight: 500;
}
.nav a:hover { background: #f1f5f9; color: var(--text); }
.nav a.active { background: var(--primary); color: #fff; }
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  background: #f1f5f9;
}
.nav-logout {
  font-size: 12px;
  font-weight: 400;
  color: var(--text2);
  text-decoration: none;
}
.nav-logout:hover { color: var(--danger); text-decoration: none; }
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 22px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
}

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Hero */
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 16px; color: var(--text2); max-width: 560px; margin: 0 auto; line-height: 1.7; }
.hero .badges { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.hero .badge {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text2);
  background: var(--card);
}

/* Section */
.section { margin: 32px 0; }
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-header h2 { font-size: 18px; font-weight: 700; }
.section-header .count { font-size: 13px; color: var(--text2); background: #f1f5f9; padding: 2px 10px; border-radius: 99px; }

/* Sub-section for PDF category grouping */
.sub-section { margin: 20px 0; }
.sub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(79,70,229,.12); transform: translateY(-2px); }
.card .icon { font-size: 32px; margin-bottom: 8px; }
.card h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.card p { font-size: 12px; color: var(--text2); }
.card .badge-soon { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #fef3c7; color: #92400e; font-weight: 600; margin-left: 4px; }
.card .badge-new { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #dcfce7; color: #166534; font-weight: 600; margin-left: 4px; }

/* Hero split layout */
.hero-split {
  text-align: left;
  padding: 36px 0 20px;
}
.hero-main {
  text-align: center;
  margin-bottom: 24px;
}
.entry-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.entry-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: 20px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all .2s ease;
  background: var(--card);
}
.entry-panel:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}
.entry-panel-image {
  background: linear-gradient(135deg, #eef6ff 0%, #f8fbff 100%);
  border-color: #bfdbfe;
}
.entry-panel-pdf {
  background: linear-gradient(135deg, #fff3f0 0%, #fffaf8 100%);
  border-color: #fdba74;
}
.entry-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
  background: rgba(255,255,255,.75);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.entry-body { flex: 1; }
.entry-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text2);
  margin-bottom: 6px;
}
.entry-body h3 {
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 6px;
}
.entry-body p {
  font-size: 13px;
  color: var(--text2);
}
.entry-count {
  align-self: flex-start;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--text);
}

.section-image,
.section-pdf {
  margin-top: 28px;
}
.section-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px;
  border-radius: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}
.section-banner-image {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 100%);
  border-color: #bfdbfe;
}
.section-banner-pdf {
  background: linear-gradient(135deg, #fff7ed 0%, #fffaf5 100%);
  border-color: #fdba74;
}
.section-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--text2);
  margin-bottom: 6px;
}
.section-banner h2 {
  font-size: 28px;
  margin-bottom: 8px;
}
.section-banner p {
  color: var(--text2);
  font-size: 14px;
  max-width: 620px;
}
.count-strong {
  background: rgba(255,255,255,.85) !important;
  padding: 8px 14px !important;
  font-weight: 700 !important;
  border: 1px solid rgba(148,163,184,.25);
}
.card-image {
  border-color: rgba(96,165,250,.18);
}
.card-image:hover {
  border-color: #60a5fa;
  box-shadow: 0 8px 24px rgba(59,130,246,.14);
}
.card-pdf {
  border-color: rgba(249,115,22,.15);
}
.card-pdf:hover {
  border-color: #f97316;
  box-shadow: 0 8px 24px rgba(249,115,22,.14);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* 默认隐藏：视觉+交互全部隐藏 */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, visibility .2s;
}
.modal-overlay.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--card);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 28px;
  position: relative;
}
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.modal .sub { color: var(--text2); font-size: 13px; margin-bottom: 20px; }
.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text2);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  z-index: 10;
}
.close-btn:hover { background: #f1f5f9; color: var(--text); }

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
  margin-bottom: 16px;
  background: #fafbfc;
  overflow: hidden;
  max-width: 100%;
}
.drop-zone:hover, .drop-zone.drag { background: #f0f0ff; border-color: var(--primary); }
.drop-zone .icon { font-size: 36px; margin-bottom: 8px; }
.drop-zone p { color: var(--text2); font-size: 14px; }
.drop-zone .hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.drop-zone.has-file { border-color: var(--success); background: #f0fdf4; }

/* Form Elements */
.form-group { margin: 12px 0; overflow: hidden; max-width: 100%; }
.form-group label { font-size: 13px; color: var(--text2); display: block; margin-bottom: 4px; font-weight: 500; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
select, input[type="number"], input[type="text"], input[type="color"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--card);
  transition: border-color .2s;
}
select:focus, input:focus { border-color: var(--primary); }
input[type="color"] { height: 38px; padding: 4px; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  font-weight: 600;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { background: #c7d2fe; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-secondary { background: #f1f5f9; color: var(--text); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Results */
.result-box { background: #f8fafc; border-radius: var(--radius); padding: 16px; margin-top: 16px; border: 1px solid var(--border); }
.result-box .stat { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.result-box .stat .label { color: var(--text2); }
.result-box .stat .value { font-weight: 600; }
.download-area { margin-top: 16px; text-align: center; }

/* File List */
.file-list { margin: 8px 0; max-height: 200px; overflow-y: auto; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f8fafc; border-radius: 8px; margin-bottom: 4px; font-size: 13px; }
.file-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .size { color: var(--text2); font-size: 12px; }
.file-item .rm { color: var(--danger); cursor: pointer; font-weight: bold; padding: 0 4px; font-size: 16px; }

/* Watermark Position Selector */
.pos-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; width: fit-content; }
.pos-cell { width: 48px; height: 36px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--text2); transition: all .15s; }
.pos-cell:hover, .pos-cell.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Toggle Switch */
.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.toggle input[type="checkbox"] { width: 36px; height: 20px; accent-color: var(--primary); cursor: pointer; }

/* Progress */
.progress-bar { width: 100%; height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-bar .fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; width: 0; }

/* Toast */
.toast { position: fixed; top: 80px; right: 24px; background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 300; opacity: 0; transform: translateX(100%); transition: all .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* Footer */
footer { text-align: center; padding: 32px 24px; color: var(--text2); font-size: 13px; margin-top: 48px; border-top: 1px solid var(--border); }

/* Responsive */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; align-items: center; }
  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--card);
    flex-direction: column;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }
  .nav.nav-open { display: flex; }
  .nav a, .nav .nav-user { padding: 10px 16px; width: 100%; border-radius: 8px; }
  .hero h1 { font-size: 28px; }
  .entry-panels { grid-template-columns: 1fr; }
  .entry-panel {
    padding: 18px;
    align-items: flex-start;
    flex-direction: column;
  }
  .entry-icon { width: 56px; height: 56px; font-size: 28px; }
  .entry-body h3 { font-size: 17px; }
  .section-banner {
    padding: 18px;
    flex-direction: column;
  }
  .section-banner h2 { font-size: 22px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .modal { padding: 20px; }
  .form-row { flex-direction: column; }
}
