/* ========================================
   在线去除重复项工具 - 样式
   ======================================== */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #e0e3e8;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #e5484d;
  --success: #10b981;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* ---- Header ---- */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 0 16px;
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand-icon { font-size: 28px; }
.brand-text { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.tagline { color: var(--text-muted); font-size: 14px; margin-left: auto; }

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

/* ---- Options Bar ---- */
.options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.opt { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 14px; user-select: none; }
.opt input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 16px; cursor: pointer; transition: all .15s;
  background: var(--surface); color: var(--text);
}
.btn:hover { border-color: #bbb; background: #fafbfc; }
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f0f2f5; border-color: transparent; }

.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-xl { padding: 14px 36px; font-size: 18px; border-radius: 12px; box-shadow: var(--shadow-lg); }

.btn-icon { font-size: 20px; }

/* ---- Editor Area ---- */
.editor-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 8px 0;
}
@media (min-width: 700px) {
  .editor-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
  }
  .actions {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-head, .panel-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}
.panel-foot { border-bottom: none; border-top: 1px solid var(--border); }
.panel-title { font-weight: 600; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.panel-meta { font-size: 13px; color: var(--text-muted); }

.textarea {
  flex: 1;
  min-height: 300px;
  padding: 14px;
  border: none;
  outline: none;
  resize: vertical;
  font-family: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  tab-size: 2;
  background: var(--surface);
  color: var(--text);
}
.textarea:focus { box-shadow: inset 0 0 0 2px var(--primary); }
.textarea[readonly] { background: #f9fafb; cursor: default; }

/* ---- Actions (center button) ---- */
.actions { padding: 8px 0; }

/* ---- Summary Stats ---- */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  text-align: center;
}
.summary .stat { padding: 8px 0; }
.summary .num { font-size: 28px; font-weight: 700; }
.summary .label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---- Duplicate Detail Table ---- */
.dupe-detail h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.dupe-detail table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.dupe-detail th, .dupe-detail td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.dupe-detail th { font-weight: 600; color: var(--text-muted); background: #fafbfc; }
.dupe-detail tr:last-child td { border-bottom: none; }

/* ---- Footer ---- */
.app-footer {
  text-align: center;
  padding: 24px 0 32px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1a1d23;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: all .3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1000;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { background: var(--danger); }

/* ---- Preserve line breaks in output (CSS) ---- */
.output-break .textarea { white-space: pre-wrap; overflow-wrap: break-word; }

/* ---- Utility ---- */
[hidden] { display: none !important; }
