/*
 * 逐梦航海团 (Ocean Diary) — design system ported from the original
 * oceandiary.net (Lovable/shadcn) build: ocean-blue/turquoise palette,
 * Inter type, soft rounded cards.
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Lora:wght@600;700&display=swap");

:root {
  --background: hsl(209 40% 96%);
  --foreground: hsl(222 47% 11%);
  --card: hsl(210 40% 98%);
  --primary: hsl(200 98% 39%);
  --primary-dark: hsl(201 80% 30%);
  --secondary: hsl(215 24% 26%);
  --muted-foreground: hsl(215 16% 46%);
  --border: hsl(212 26% 83%);
  --danger: hsl(0 72% 50%);
  --gradient-ocean: linear-gradient(135deg, hsl(207 90% 24%) 0%, hsl(201 80% 35%) 50%, hsl(181 67% 47%) 100%);
  --radius: 0.75rem;
  --shadow-soft: 0 10px 30px -5px hsl(210 24% 16% / 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--foreground);
  background: var(--background);
  line-height: 1.6;
}

.wrap {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: "Lora", "Noto Sans SC", "Inter", serif; line-height: 1.25; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(209 40% 96% / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.site-header .brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--foreground);
  font-family: "Lora", "Noto Sans SC", serif;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-header nav a { color: var(--foreground); font-weight: 500; }
.site-header nav a:hover { color: var(--primary); text-decoration: none; }
.site-header nav form { display: inline; }
.site-header nav button {
  background: none;
  border: none;
  font: inherit;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  padding: 0;
}
.site-header nav button:hover { color: var(--primary); }

.btn, button[type="submit"], input[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--primary);
  color: #fff !important;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, background .2s ease;
}
.btn:hover, button[type="submit"]:hover, input[type="submit"]:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}
.btn.outline {
  background: transparent;
  color: var(--foreground) !important;
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.outline:hover { background: hsl(210 40% 92%); }

.link-btn, button[type="submit"].link-btn, input[type="submit"].link-btn {
  display: inline;
  background: none !important;
  color: var(--danger) !important;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  font-weight: 500;
  box-shadow: none;
  text-decoration: none;
}
.link-btn:hover { text-decoration: underline; transform: none; }

/* Flash */
.flash { padding: 0.75rem 0; }
.flash .wrap { padding: 0.6rem 1.5rem; border-radius: var(--radius); }
.flash.notice .wrap { background: #e2f5ea; color: #1c5c37; }
.flash.alert .wrap { background: #fbe6e4; color: var(--danger); }

/* Hero */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: #fff;
  background: var(--gradient-ocean) center/cover no-repeat;
}
.hero .hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, hsl(207 90% 16% / .55), hsl(207 90% 16% / .35), hsl(207 90% 10% / .75));
}
.hero .hero-content { position: relative; z-index: 1; max-width: 720px; padding: 0 1.5rem; }
.hero h1 { font-size: 3rem; margin: 0 0 1.25rem; font-weight: 700; }
.hero p { font-size: 1.25rem; max-width: 640px; margin: 0 auto 2rem; opacity: .95; }

@media (max-width: 640px) {
  .hero h1 { font-size: 2.1rem; }
}

/* About */
.about-section { padding: 5rem 0; text-align: center; }
.about-section h2 { font-size: 2.25rem; margin-bottom: 1.5rem; }
.about-section p { max-width: 720px; margin: 0 auto; color: var(--muted-foreground); font-size: 1.1rem; }

/* Destination cards */
.destinations { padding: 5rem 0; background: hsl(210 40% 93%); }
.destinations h2 { text-align: center; font-size: 2.25rem; margin-bottom: 3rem; }
.destination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}
.destination-card {
  background: var(--card);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
.destination-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -10px hsl(207 90% 24% / .25); }
.destination-card .thumb {
  height: 200px;
  background: var(--gradient-ocean);
  background-size: cover;
  background-position: center;
}
.destination-card .body { padding: 1.5rem; }
.destination-card h3 { margin: 0 0 .5rem; font-size: 1.4rem; }
.destination-card p { color: var(--muted-foreground); }

/* Sections */
section { padding: 2rem 0; }
.section-title { text-align: center; margin-bottom: 2rem; font-size: 2rem; }

/* Blog */
.blog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.post-list { display: grid; gap: 3rem; }
.post-card { padding-bottom: 2.5rem; border-bottom: 1px solid var(--border); }
.post-card:last-child { border-bottom: none; }
.post-card .thumb {
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  height: 280px;
  background-size: cover;
  background-position: center;
}
.post-card h2 { font-size: 1.6rem; margin: 0 0 .5rem; }
.post-card h2 a { color: var(--foreground); }
.post-card h2 a:hover { color: var(--primary); text-decoration: none; }
.post-show img { max-width: 100%; border-radius: 1rem; margin: 1.5rem 0; }
.post-show iframe { border-radius: 1rem; }
.post-body { font-size: 1.05rem; }
.post-body h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.post-body h3 { font-size: 1.25rem; margin: 1.5rem 0 .75rem; }
.post-body p { margin: 0 0 1rem; }
.post-body ul, .post-body ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.post-body li { margin-bottom: .4rem; }
.post-body blockquote { border-left: 3px solid var(--primary); margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; color: var(--muted-foreground); font-style: italic; }
.post-body strong { color: var(--foreground); }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: .5rem .75rem; text-align: left; }
.post-body code { background: hsl(210 40% 92%); padding: .15rem .4rem; border-radius: .3rem; font-size: .9em; }
.post-body pre { background: hsl(210 40% 92%); padding: 1rem; border-radius: .5rem; overflow-x: auto; }
.post-meta { color: var(--muted-foreground); font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; }
.post-excerpt { color: var(--muted-foreground); margin: .75rem 0; }
.read-more { font-weight: 600; }

/* Forms */
form.styled { max-width: 640px; }
form.styled label { display: block; font-weight: 600; margin: 1rem 0 .25rem; }
form.styled input[type=text], form.styled input[type=email], form.styled input[type=tel],
form.styled input[type=date], form.styled input[type=number], form.styled input[type=password],
form.styled textarea, form.styled select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  font: inherit;
  background: var(--card);
  color: var(--foreground);
}
form.styled input[type=date] {
  padding-right: 0.4rem;
  -webkit-appearance: none;
  appearance: none;
}
form.styled .checkbox-row { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; }
form.styled .checkbox-row label { display: inline; margin: 0; font-weight: 400; }
form.styled fieldset { border: 1px solid var(--border); border-radius: 1rem; margin-top: 1.5rem; padding: 1.25rem 1.5rem; }
form.styled legend { font-weight: 700; color: var(--primary-dark); padding: 0 .5rem; }
.field_with_errors input, .field_with_errors textarea { border-color: var(--danger); }
.error-summary { background: #fbe6e4; color: var(--danger); padding: 1rem; border-radius: .5rem; margin-bottom: 1rem; }

/* Admin */
.admin-page { padding: 2.5rem 0; }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-header h1 { margin: 0 0 .35rem; font-size: 1.9rem; }
.admin-header p { margin: 0; color: var(--muted-foreground); }
.admin-header .actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.admin-tabs { display: flex; gap: .5rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.admin-tabs a {
  display: inline-block;
  padding: .65rem 1rem;
  color: var(--muted-foreground);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.admin-tabs a:hover { color: var(--foreground); text-decoration: none; }
.admin-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
}
.admin-card h2 { font-size: 1.2rem; margin: 0 0 1.25rem; }
.admin-card + .admin-card { margin-top: 0; }

.admin-section { border-top: 1px solid var(--border); padding-top: 1.5rem; margin-top: 1.5rem; }
.admin-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.admin-section h3 { font-size: 1.05rem; margin: 0 0 1rem; color: var(--primary-dark); }
.hint { color: var(--muted-foreground); font-size: .85rem; margin: .5rem 0 .75rem; }
form.styled input[type=file] { display: block; margin-top: .3rem; }

.admin-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.5rem; }

.admin-image-preview { max-width: 220px; border-radius: .6rem; display: block; margin-bottom: .6rem; border: 1px solid var(--border); }

details.admin-advanced { margin-top: .5rem; }
details.admin-advanced > summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); padding: .75rem 0; }
details.admin-advanced[open] > summary { margin-bottom: .5rem; }

table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.admin-table th { color: var(--muted-foreground); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
table.admin-table tbody tr:hover { background: hsl(210 40% 97%); }
table.admin-table .muted { color: var(--muted-foreground); font-size: .85rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 1rem; background: var(--card); box-shadow: var(--shadow-soft); }
.table-wrap table.admin-table { margin: 0; }
.table-wrap table.admin-table th:first-child, .table-wrap table.admin-table td:first-child { padding-left: 1.25rem; }
.table-wrap table.admin-table th:last-child, .table-wrap table.admin-table td:last-child { padding-right: 1.25rem; }

.post-thumb-list { display: grid; gap: 1.25rem; }
.post-thumb-card { display: flex; gap: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: 1rem; padding: 1rem; box-shadow: var(--shadow-soft); }
.post-thumb-card .thumb { width: 96px; height: 96px; flex-shrink: 0; border-radius: .6rem; background-size: cover; background-position: center; background-color: hsl(210 40% 90%); }
.post-thumb-card .body { flex: 1; min-width: 0; }
.post-thumb-card h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.post-thumb-card .meta { color: var(--muted-foreground); font-size: .82rem; }
.post-thumb-card .actions { display: flex; gap: .75rem; margin-top: .5rem; font-size: .85rem; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge.published { background: #e2f5ea; color: #1c5c37; }
.badge.draft { background: hsl(210 40% 90%); color: var(--muted-foreground); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 2rem 0; color: var(--muted-foreground); text-align: center; }
