
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Zen+Maru+Gothic:wght@400;500;700&display=swap');

:root {
  --primary: #ff9eb5;
  --primary-dark: #ff7a9c;
  --primary-light: #ffd1dc;
  --accent: #ffb7c5;
  --text: #5c4d4d;
  --text-muted: #9b8a8a;
  --bg: #fffbfc;
  --bg-secondary: #fff5f7;
  --bg-card: #ffffff;
  --border: #ffd6e0;
  --success: #7ecba1;
  --danger: #ff8fab;
  --max-width: 800px;
  --shadow: 0 4px 20px rgba(255, 158, 181, 0.15);
  --shadow-hover: 0 8px 30px rgba(255, 158, 181, 0.25);
}

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

html {
  overflow-x: hidden;
}

body {
  font-family: "Zen Maru Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: linear-gradient(135deg, #fff5f7 0%, #fff9fb 50%, #f8f4ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 218, 233, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(230, 190, 255, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

a { color: var(--primary-dark); text-decoration: none; transition: all 0.3s ease; }
a:hover { color: var(--primary); text-decoration: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.header {
  padding: 1.5rem 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 2px dashed var(--border);
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 700;
  position: relative;
}

.site-title::before {
  content: '✿';
  margin-right: 0.5rem;
  color: var(--primary);
}

.site-title a { 
  color: var(--text); 
  background: linear-gradient(135deg, var(--primary) 0%, #c9a0dc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav { display: flex; gap: 1.5rem; }
.nav a { 
  color: var(--text-muted); 
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  transition: all 0.3s ease;
}
.nav a:hover { 
  color: var(--primary-dark); 
  background: var(--bg-secondary);
}

/* Main */
.main { min-height: 60vh; padding-bottom: 3rem; }

/* Posts List */
.posts-list { display: flex; flex-direction: column; gap: 1.5rem; }

.post-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), #c9a0dc);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.post-card:last-child { border-bottom: none; }

.post-title { font-size: 1.3rem; margin-bottom: 0.5rem; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--primary-dark); }

.post-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.post-meta::before {
  content: '♡';
  color: var(--primary);
}

.post-excerpt { color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.7; }

.read-more { 
  font-size: 0.9rem; 
  font-weight: 500;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.read-more::after { content: ' →'; transition: transform 0.3s; }
.read-more:hover::after { transform: translateX(4px); }

/* Single Post */
.post-header { 
  margin-bottom: 2rem; 
  padding-bottom: 1.5rem; 
  border-bottom: 2px dashed var(--border);
  text-align: center;
}
.post-header h1 { 
  font-size: 1.8rem; 
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-content { 
  font-size: 1.05rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.post-content h2 { 
  font-size: 1.4rem; 
  margin: 2rem 0 1rem;
  color: var(--primary-dark);
  position: relative;
  padding-left: 1rem;
}
.post-content h2::before {
  content: '❀';
  position: absolute;
  left: -0.5rem;
  color: var(--primary);
}
.post-content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; color: var(--text); }
.post-content p { margin-bottom: 1.25rem; }
.post-content img { 
  max-width: 100%; 
  height: auto; 
  border-radius: 16px; 
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}
.post-content pre {
  background: linear-gradient(135deg, #fff5f7 0%, #f8f4ff 100%);
  padding: 1.2rem;
  border-radius: 16px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.post-content code {
  font-family: "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.9em;
  background: var(--bg-secondary);
  padding: 0.2em 0.5em;
  border-radius: 6px;
  color: var(--primary-dark);
  word-break: break-word;
}
.post-content pre code { background: none; padding: 0; color: var(--text); word-break: normal; }

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.post-content th, .post-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.post-content th {
  background: var(--bg-secondary);
  font-weight: 600;
}
.post-content tr:hover { background: var(--bg-secondary); }
.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-secondary);
  border-radius: 0 16px 16px 0;
  color: var(--text-muted);
  font-style: italic;
}
.post-content ul, .post-content ol { margin: 1rem 0 1rem 1.5rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content li::marker { color: var(--primary); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tag {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #fff 100%);
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.tag::before { content: '#'; color: var(--primary); margin-right: 2px; }
.tag:hover { 
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white; 
  border-color: var(--primary);
  transform: scale(1.05);
}
.tag:hover::before { color: white; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--border);
}

.pagination a {
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.pagination a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.page-info { color: var(--text-muted); font-size: 0.9rem; }

/* Footer */
.footer {
  padding: 2rem 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-top: 2px dashed var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer::before {
  content: '♡ ♡ ♡';
  display: block;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5rem;
}

/* Archive */
.archive-header { 
  margin-bottom: 2rem; 
  padding-bottom: 1rem; 
  border-bottom: 2px dashed var(--border);
  text-align: center;
}
.archive-header h1 { 
  font-size: 1.6rem; 
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}
.archive-header h1::before { content: '📚 '; }
.archive-header p { color: var(--text-muted); }

.archive-list { list-style: none; }
.archive-year { 
  font-size: 1.2rem; 
  font-weight: 600; 
  margin: 2rem 0 1rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.archive-year::before { content: '✿'; color: var(--primary); }
.archive-item { 
  padding: 0.6rem 1rem; 
  display: flex; 
  gap: 1rem; 
  align-items: baseline;
  background: var(--bg-card);
  margin-bottom: 0.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}
.archive-item:hover {
  border-color: var(--border);
  transform: translateX(8px);
}
.archive-date { color: var(--text-muted); font-size: 0.85rem; min-width: 100px; }

/* Error Page */
.error-page {
  text-align: center;
  padding: 4rem 1.5rem;
}
.error-page h1 { 
  font-size: 4rem; 
  background: linear-gradient(135deg, var(--primary) 0%, #c9a0dc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.error-page p { font-size: 1.2rem; color: var(--text-muted); margin: 1rem 0 2rem; }
.error-page p::before { content: '(｡•́︿•̀｡) '; }

/* Button */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 25px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 158, 181, 0.4);
  transition: all 0.3s ease;
}
.btn:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 158, 181, 0.5);
  color: white;
}

/* Admin */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #5c4d4d 0%, #4a3f3f 100%);
  color: white;
  padding: 1.5rem;
  flex-shrink: 0;
}

.admin-logo { 
  font-size: 1.2rem; 
  font-weight: 700; 
  margin-bottom: 2rem;
  text-align: center;
}
.admin-logo::before { content: '✿ '; color: var(--primary); }
.admin-logo::after { content: ' ✿'; color: var(--primary); }
.admin-logo a { color: white; }

.admin-nav { list-style: none; }
.admin-nav a {
  display: block;
  padding: 0.75rem 1rem;
  color: rgba(255,255,255,0.7);
  border-radius: 12px;
  margin-bottom: 0.25rem;
  transition: all 0.3s ease;
}
.admin-nav a:hover, .admin-nav a.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-decoration: none;
}

.admin-main { flex: 1; padding: 2rem; background: var(--bg); }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-header h1 { font-size: 1.4rem; color: var(--text); }

.admin-card {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 158, 181, 0.2);
}
.form-group textarea { min-height: 300px; font-family: monospace; }

.btn-group { display: flex; gap: 1rem; margin-top: 1.5rem; }
.btn-secondary { 
  background: var(--bg-secondary); 
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: linear-gradient(135deg, #ff8fab 0%, #ff6b8a 100%); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; background: var(--bg-secondary); color: var(--text); }
.table tr:hover { background: var(--bg-secondary); }

.status-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-published { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #065f46; }
.status-draft { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat-card { 
  background: white; 
  padding: 1.5rem; 
  border-radius: 20px; 
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-value { 
  font-size: 2rem; 
  font-weight: 700; 
  background: linear-gradient(135deg, var(--primary) 0%, #c9a0dc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  .header .container { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 0.5rem; }
  .nav a { padding: 0.3rem 0.6rem; font-size: 0.9rem; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-main { padding: 1rem; }
  .site-title { font-size: 1.4rem; }
  .post-header h1 { font-size: 1.5rem; }
  .post-content pre { padding: 0.8rem; font-size: 0.85rem; }
  .post-content h2 { padding-left: 0.5rem; }
  .post-content h2::before { left: -0.8rem; }
  .pagination { gap: 0.75rem; flex-wrap: wrap; }
  .pagination a { padding: 0.5rem 1rem; font-size: 0.9rem; }
  .post-card { padding: 1.2rem; }
  .archive-item { flex-direction: column; gap: 0.25rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { 
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* Selection */
::selection {
  background: var(--primary-light);
  color: var(--text);
}
