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

:root {
  --bg-color: #faf8fc;
  --surface-color: #ffffff;
  --primary-color: #a890d3;
  --primary-hover: #8e73be;
  --text-main: #3d3345;
  --text-muted: #857c8d;
  --border-color: #ebe4f2;
  --shadow-sm: 0 4px 6px -1px rgba(168, 144, 211, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(168, 144, 211, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.8);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-hover);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--primary-color);
  color: white !important;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color) !important;
  border: 1px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white !important;
}

/* Main Content */
main {
  flex: 1;
  padding: 3rem 0;
}

/* Forms */
.auth-form, .post-form {
  background: var(--surface-color);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  max-width: 500px;
  margin: 0 auto;
  border: 1px solid var(--border-color);
}

.post-form {
  max-width: 800px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: var(--bg-color);
  color: var(--text-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(168, 144, 211, 0.2);
}

textarea.form-control {
  min-height: 300px;
  resize: vertical;
  font-family: 'Noto Serif JP', serif;
  line-height: 1.8;
}

/* Novel List */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.novel-card {
  background: var(--surface-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  display: block;
}

.novel-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.novel-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary-hover);
  font-family: 'Noto Serif JP', serif;
}

.novel-card .author {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.novel-card .excerpt {
  font-size: 0.95rem;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.novel-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}

/* Novel Reader */
.reader-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--surface-color);
  padding: 4rem 3rem;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.reader-header {
  text-align: center;
  margin-bottom: 3rem;
}

.reader-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 2.5rem;
  color: var(--primary-hover);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.reader-author {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.reader-content {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.15rem;
  line-height: 2.2;
  color: var(--text-main);
  white-space: pre-wrap;
  letter-spacing: 0.5px;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.alert-error {
  background: #fde8e8;
  color: #c53030;
  border: 1px solid #fbd5d5;
}

.alert-success {
  background: #def7ec;
  color: #046c4e;
  border: 1px solid #bcdefa;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}
