/* 白色現代主題 */
:root {
  --bg: #f9f9f9;
  --text: #111827;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --muted: #f3f4f6;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(0,0,0,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Inter", "Helvetica Neue", sans-serif; }
body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
header {
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}
header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.5px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, rgba(0,226,211,1) 0%,rgba(5,117,191,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  color: #fff;
  border: none;
  padding: .6rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn:hover { background: linear-gradient(135deg, rgba(0,206,191,1) 0%,rgba(5,107,181,1) 100%); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
}
.banner {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}
.banner p { font-size: .95rem; }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: .5rem; font-size: .9rem; }
input[type="url"] {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}
input[type="url"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.alert {
  padding: .9rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1rem;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.list {
  margin-top: 2rem;
}
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  background: var(--muted);
  transition: transform .15s;
}
.list-item:hover { transform: translateY(-2px); }
.list-item div { min-width: 0; }
.list-item .long {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6b7280;
  font-size: .9rem;
}
.list-item .short {
  font-weight: 600;
  color: var(--primary);
  font-family: monospace;
  font-size: .95rem;
}
.list-item .clicks {
  font-size: .8rem;
  color: #6b7280;
  margin-left: 1rem;
}
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  padding: .35rem .6rem;
  border-radius: 6px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s;
}
.copy-btn:hover { background: var(--muted); }
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: .8rem;
  color: #9ca3af;
}

/* 表單頁共用 */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  width: 100%;
  margin: 1rem auto;
  padding: 2rem;
}
.card h2 {
  margin-bottom: 1.2rem;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
}
.card form {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.card input {
  padding: .7rem .9rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}
.card button {
  padding: .7rem;
  border: none;
  border-radius: 50px;
  border:1px solid #f5f5f5;
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.card button:hover {
  background: #f5f5f5;
}
/* 讓卡片內的主要按鈕使用漸層樣式 */
.card .btn {
  background: linear-gradient(135deg, rgba(0,226,211,1) 0%, rgba(5,117,191,1) 100%) !important;
  color: #fff !important;
  border: none !important;
}
.card .btn:hover {
  background: linear-gradient(135deg, rgba(0,206,191,1) 0%, rgba(5,107,181,1) 100%) !important;
}
.link-row {
  margin-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
}
.link-row a {
  color: #2563eb;
  text-decoration: none;
.error {
  background: #fee;
  color: #c00;
}

/* 分頁樣式 */
.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
}

.pagination.justify-content-center {
  justify-content: center;
}

.page-item {
  display: inline-block;
}

.page-link, .page-item span {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  min-width: 2.5rem;
  text-align: center;
}

.page-link:hover {
  background: var(--muted);
  border-color: var(--primary);
  color: var(--primary);
}

.page-item.active span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-item.disabled span {
  color: #9ca3af;
  background: #f9fafb;
  border-color: var(--border);
  cursor: not-allowed;
} padding: .6rem .8rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.info {
  background: #e0f2fe;
  color: #0c5460;
  padding: .6rem .8rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: .9rem;
}

/* 小按鈕 */
.btn-sm {
  padding: .25rem .5rem;
  font-size: .875rem;
  border-radius: 4px;
}
.btn-dark {
  background: #111;
  color: #fff;
  border: 1px solid #111;
}
.btn-dark:hover {
  background: #000;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
  border: 1px solid #ef4444;
}
.btn-danger:hover {
  background: #dc2626;
}
/* 關鍵字輸入（標籤） */
.kw-input {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  padding: .5rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: text;
  min-height: 44px;
  transition: box-shadow .2s, border-color .2s;
}
.kw-input:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.kw-input input {
  border: none;
  outline: none;
  min-width: 160px;
  flex: 1;
  padding: .4rem;
}
.kw-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #eee;
  color: #555;
  border-radius: 12px;
  padding: .15rem .5rem;
  font-size: .75rem;
}
.kw-tag .kw-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #555;
  font-size: .9em;
}
/* 按鈕內的垃圾桶圖示固定為黑色 */
button i.fa-trash,
button i.fa-trash-alt,
.icon-btn i.fa-trash,
.icon-btn i.fa-trash-alt {
  color: #000 !important;
}

/* 讓紅色刪除按鈕上的垃圾桶 icon 顯示為白色 */
.btn-danger i.fa-trash,
.btn-danger i.fa-trash-alt {
  color: #fff !important;
}

.modal-close-x {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@keyframes spin360 { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin360 1s linear infinite; display: inline-block; }

/* Admin header/nav RWD */
.admin-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}
.admin-header nav { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; }
.admin-header nav form { display:inline-flex; }
.admin-header nav .btn { background:#fff; color:#111; border:1px solid #ddd; }

/* Responsive auto grid for cards */
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* Thumbnail action buttons (overlay) */
.thumb-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 2; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(0,0,0,0.55); color: #fff; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.icon-btn:hover { background: rgba(0,0,0,0.75); }
.icon-btn--white { background:#fff; color:#111827; border:1px solid #e5e7eb; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.icon-btn--white:hover { background:#fff; box-shadow: 0 6px 16px rgba(0,0,0,.18); }

/* Table responsive wrapper */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background:#fff; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
.table-wrap th { background:#fafafa; }
.table-wrap tr:last-child td { border-bottom: none; }
