@charset "utf-8";

:root {
  --bg: #1e1f25;
  --bg-w50: #343434;
  --panel: #11131a;
  --ink: #fff;
  --muted: #a3a6b3;
  --brand: #51557e;
  --accent: #22cc88;
  --chip: #1a1d27;
  --ring: #b6c0ff38;
  --card: #272934;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --btn-light: #525252;
  --btn-hover: #5561bc;
  --btn-chip-h:#46495d;
  --border-w-50:#ffffff8d;
}
* {
  box-sizing: border-box;
}
#TOP {
  position: absolute;
  top: -95px;
  padding-top: 0px;
  right: 10px;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 999;
  opacity: 0.8;
  /* border-radius: 11px;
  box-shadow: 0px 2px 6px 1px rgba(69, 69, 69, 0.4); */
  transition: 0.3s;
}
#TOP:hover {
  opacity: 1;
}
#TOP:hover::before{
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  content: "TOP";
  transition: 0.3s;
  font-weight: bold;

}
#TOP img {
  width: 100%;
  height: auto;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans TC", sans-serif;
  cursor: url('../images/fish.svg') 0 0, auto;
  outline: none;
}
a {
  color: inherit;
  text-decoration: none;
}

a:hover,input:hover,button:hover,select:hover,option:hover{
   cursor: url('../images/fish-btn.svg') 0 0, auto;
}
input[type="text"], input[type="search"], textarea{
  cursor: url('../images/fish-font.svg') 0 0, auto;
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
}
header {
  display: grid;
  gap: 20px;
  margin-bottom: 18px;
}
.title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.title h1 {
  font-size: 25px;
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.title .tag {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #203, #111);
  border: 1px solid #2b0f3a;
  color: #e9d7ff;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.search {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.search input {
  width: 100%;
  padding: 12px 40px 12px 40px;
  border-radius: 999px;
  background: #0c0e14;
  border: 1px solid var(--ring);
  color: var(--ink);
  outline: none;
  font-size: 15px;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}
.btn,
select,
input[type="url"] {
  height: 38px;
  appearance: none;
  border: 1px solid var(--ring);
  background: var(--brand);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
}
select{
  /* background: var(--card); */
}
select option{
  background: var(--card);
}
.btn:hover,
input[type="url"]:hover {
  background-color: var(--btn-hover);
  transition: 0.3s;
}
input[type="url"] {
  min-width: 280px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn[data-active="true"] {
  background: var(--btn-hover);
  border-color: var(--border-w-50);
}
.btn img{
  /* width: 20px; */
  height: 18px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--chip);
  border: 1px solid var(--ring);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
}
.chip:hover {
  background: var(--btn-chip-h);
}
.chip[data-active="true"] {
  background: var(--btn-chip-h);
  color: #fff;
  border-color: var(--border-w-50);
}
.panel {
  /* background: var(--bg-w50); */
  /* border: 1px solid var(--ring); */
  /* border-radius: var(--radius); */
  /* padding: 20px; */
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 25px;
}
@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(8, 1fr);
  }
}
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.card {
  grid-column: span 4;
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  overflow: hidden;
  /* box-shadow: var(--shadow); */
  display: flex;
  flex-direction: column;
}
.thumb {
  position: relative;
  aspect-ratio: 16/10;
  background: #262626;
  display: block;
  overflow: hidden;
}
.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1, 1);
  transition: ease-in-out 0.3s;
}
.thumb:hover img {
  transform: scale(1.1, 1.1);
}
.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(16, 20, 30, 0.8);
  backdrop-filter: blur(6px);
  border: 1px solid var(--ring);
}
.body {
  padding: 14px 14px 12px 14px;
  display: grid;
  gap: 10px;
}
.name {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}
.meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
  align-self: center;
}
.actions {
  margin-top: auto;
  padding: 12px 14px;
  display: flex;
  gap: 8px;
}
.ghost {
  /* border: 1px dashed var(--ring); */
  background: var(--card);
}
.ghost:hover{
  background: var(--btn-chip-h);
}
.mark {
  background: linear-gradient(90deg, rgba(79, 124, 255, 0.35), rgba(34, 204, 136, 0.35));
  padding: 0 0.2em;
  border-radius: 6px;
}
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.footer {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* 詳細頁 */
.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 15px;
}
.crumbs a {
  opacity: 0.9;
}
.headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.headline h2 {
  margin: 0;
  font-size: 25px;
  padding-bottom: 5px;
}
.sub {
  color: var(--muted);
  font-size: 15px;
}
.layout-card {
  grid-column: span 6;
  background: var(--card);
  border: 1px solid var(--ring);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.layout-thumb {
  position: relative;
  aspect-ratio: 14/9;
  background: #0b0e14;
}
.layout-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.layout-body {
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.layout-body > strong {
  font-size: 20px;
}
.layout-body .actions {
  padding: 12px 0px;
}
/* 匯入/匯出對話框 */
dialog {
  border: 1px solid var(--ring);
  border-radius: 14px;
  background: #0c0f16;
  color: var(--ink);
  box-shadow: var(--shadow);
  max-width: 720px;
  width: clamp(300px, 80vw, 720px);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.dlg-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ring);
}
.dlg-bd {
  padding: 14px 16px;
}
.dlg-ft {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--ring);
}
textarea {
  width: 100%;
  min-height: 200px;
  background: #0a0d14;
  border: 1px solid var(--ring);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px;
  font-family: ui-monospace, Consolas, Monaco, Menlo, "Noto Sans Mono", monospace;
}

/* 測試面板（僅失敗時顯示） */
.test-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 360px;
  background: #0d111a;
  border: 1px solid var(--ring);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 12px 8px 12px;
  color: #fff;
  z-index: 9999;
  display: none;
}
.test-panel h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
}
.test-panel ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  max-height: 200px;
  overflow: auto;
}
.test-panel .ok {
  color: #8fe39c;
}
.test-panel .fail {
  color: #ff9aa2;
}
.test-panel .close {
  position: absolute;
  top: 6px;
  right: 8px;
  cursor: pointer;
  opacity: 0.7;
}
