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

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
}

header {
  background: #cb0715;
  color: white;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
}

.tagline {
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 400;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 12px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.header-nav a:hover {
  opacity: 0.8;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container {
  height: calc(100vh - 60px);
  display: flex;
  gap: 0;
  padding: 12px;
  min-height: 0;
  position: relative;
  flex-shrink: 0;
}

.resize-handle {
  width: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: col-resize;
  flex-shrink: 0;
}

.dot {
  width: 3px;
  height: 3px;
  background: #999;
  border-radius: 50%;
}

.resize-handle:hover .dot {
  background: #666;
}

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  position: relative;
}

.panel-input {
  flex: 0 0 calc(var(--panel-width, 50%) - 4px);
}

.panel-output {
  flex: 0 0 calc(100% - var(--panel-width, 50%) - 4px);
}

.drop-zone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 60%;
  border: 2px dashed #ddd;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #999;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 5;
}

.panel.drag-over {
  background-color: #fff9f9;
}

.drop-zone.drag-over {
  border-color: #cb0715;
}

.container.resizing {
  cursor: col-resize;
}

.link-style {
  color: #cb0715;
  text-decoration: underline;
  pointer-events: auto;
  cursor: pointer;
}

#fileInput {
  display: none;
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.panel-input.has-content .drop-zone,
.panel-output.has-content .output-placeholder {
  opacity: 0;
  visibility: hidden;
}

.output-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #aaa;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 5;
  text-align: center;
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.8;
}

.placeholder-text {
  font-size: 1rem;
  font-weight: 500;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.drop-icon {
  font-size: 3rem;
  opacity: 0.8;
}

.drop-text {
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

.panel-header {
  background: white;
  color: #333;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-copy {
  background: #cb0715;
  color: white;
}

.btn-copy:hover {
  background: #a00510;
}

.btn-clear {
  background: #cb0715;
  color: white;
}

.btn-clear:hover {
  background: #a00510;
}

.btn-download {
  background: #28a745;
  color: white;
}

.btn-download:hover {
  background: #218838;
}

.panel-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-header-controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: normal;
  cursor: pointer;
  color: #666;
}

.panel-header-controls input[type="checkbox"] {
  accent-color: #cb0715;
  width: 14px;
  height: 14px;
}

.panel textarea {
  flex: 1;
  width: 100%;
  border: none;
  resize: none;
  padding: 12px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  background: white;
  color: #333;
}

.panel textarea:focus {
  outline: none;
}

.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: calc(50% - 4px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #666;
  background: white;
  border: 1px solid #ddd;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  z-index: 20;
  animation: bounce 2s infinite;
}

.scroll-hint.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
}

.scroll-hint:hover {
  background: #fdfdfd;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: #ccc;
  color: #cb0715;
}

.scroll-hint:focus {
  outline: 2px solid #cb0715;
  outline-offset: 2px;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translate(-50%, 0);
  }
  40% {
    transform: translate(-50%, -8px);
  }
  60% {
    transform: translate(-50%, -4px);
  }
}

.scroll-hint .arrow {
  font-size: 1rem;
}

.status {
  font-size: 0.75rem;
  color: #999;
  margin-left: 8px;
  font-weight: normal;
}

.status.done {
  color: #28a745;
}

.status.error {
  color: #dc3545;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}

.loading-overlay.hidden {
  display: none;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #eee;
  border-top-color: #cb0715;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.9rem;
  color: #666;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1001;
}

.toast.show {
  opacity: 1;
}
.toast.success {
  background: #28a745;
}
.toast.error {
  background: #dc3545;
}

.about-info {
  background: white;
  padding: 80px 20px;
  border-top: 1px solid #eee;
}

.about-container {
  max-width: 900px;
  margin: 0 auto;
}

.info-card {
  background: #fdfdfd;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 60px;
  display: flex;
  gap: 24px;
}

.privacy-hero {
  background: #fff5f5;
  border-color: #fee2e2;
  align-items: center;
}

.info-icon {
  font-size: 2.5rem;
  background: white;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.privacy-hero h2 {
  color: #cb0715;
  margin-bottom: 8px;
}

.privacy-points {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0;
}

.privacy-points span {
  font-size: 0.9rem;
  color: #218838;
  font-weight: 600;
  background: white;
  padding: 4px 12px;
  border-radius: 16px;
  border: solid 1px #d1fae5;
}

.github-cta {
  font-size: 0.9rem;
}

.github-cta a {
  color: #cb0715;
  text-decoration: none;
  font-weight: 600;
}

.info-section {
  margin-bottom: 80px;
}

.info-section h2 {
  font-size: 1.8rem;
  margin-bottom: 24px;
  color: #333;
  text-align: center;
}

.info-section > p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #666;
  text-align: center;
  max-width: 700px;
  margin: 0 auto 40px;
}

.use-cases {
  background: #f9f9f9;
  padding: 40px;
  border-radius: 12px;
}

.use-cases h3 {
  text-align: center;
  margin-bottom: 30px;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: #999;
}

.use-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
}

.use-case h4 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.use-case p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #666;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.seo-grid h3 {
  margin-bottom: 12px;
  color: #cb0715;
  font-size: 1.1rem;
}

.seo-grid p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
}

.technical-philosophy {
  background: #333;
  color: white;
  padding: 60px;
  border-radius: 12px;
  text-align: center;
}

.technical-philosophy h2 {
  color: white;
}

.technical-philosophy p {
  color: #ccc;
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
}

.technical-philosophy a {
  color: #cb0715;
  text-decoration: none;
  font-weight: 600;
}

.name-box {
  background: #f9f9f9;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
}

.name-box p {
  max-width: 600px;
  margin: 20px auto 20px;
  color: #666;
  line-height: 1.6;
}

.name-gif {
  text-align: center;
  margin: 30px 0;
}

.name-gif img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.legal-note {
  font-size: 0.85rem;
  color: #999;
  font-style: italic;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .info-card {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .info-icon {
    margin: 0 auto;
  }

  .privacy-points {
    justify-content: center;
  }

  .technical-philosophy {
    padding: 30px;
  }
}

@media (max-width: 600px) {
  .container {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 60px);
  }

  .resize-handle {
    display: none;
  }

  .panel {
    min-height: 350px;
  }
}
