/* FlashNote - 樣式表 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: #fff8e1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #333;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  padding: 40px;
  animation: fadeIn 0.5s ease-in;
}

/* 桌面版：更宽的容器和更大的字体 */
@media (min-width: 768px) {
  .container {
    max-width: 900px;
    padding: 50px 60px;
  }

  h1 {
    font-size: 3em;
  }

  .subtitle {
    font-size: 1.2em;
  }

  textarea,
  select,
  input {
    font-size: 1.05em;
  }

  textarea {
    min-height: 200px;
  }

  textarea.expanded {
    min-height: 70vh;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 2.5em;
  margin-bottom: 8px;
  color: #f57c00;
}

.subtitle {
  color: #666;
  font-size: 1.1em;
}

.form-group {
  margin-bottom: 24px;
}

.textarea-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.expand-btn {
  background: #f57c00;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: background 0.2s;
}

.expand-btn:hover {
  background: #e65100;
}

.expand-btn:active {
  transform: scale(0.95);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.textarea-header label {
  margin-bottom: 0;
}

textarea,
select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  transition: border-color 0.3s;
}

textarea {
  resize: vertical;
  min-height: 150px;
  transition: all 0.3s ease;
}

textarea.expanded {
  min-height: 70vh;
  font-size: 1.1em;
}

textarea:focus,
select:focus {
  outline: none;
  border-color: #f57c00;
}

.char-count {
  text-align: right;
  color: #999;
  font-size: 0.9em;
  margin-top: 4px;
}

.checkbox label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  cursor: pointer;
}

button[type="submit"] {
  width: 100%;
  padding: 16px;
  background: #ff9800;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(255, 152, 0, 0.4);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.info-box {
  margin-top: 32px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #ff9800;
}

.info-box h3 {
  margin-bottom: 12px;
  color: #f57c00;
}

.info-box ul {
  list-style: none;
}

.info-box li {
  padding: 8px 0;
  color: #555;
}

footer {
  margin-top: 32px;
  text-align: center;
  color: #999;
  font-size: 0.9em;
}

.dev-info {
  margin-top: 8px;
  color: #f57c00;
  font-weight: 600;
}

/* Turnstile 容器 */
.cf-turnstile {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

/* 6 位數代碼輸入 */
.code-input-section {
  text-align: center;
  margin-bottom: 32px;
}

.code-input-container {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0;
}

.code-digit {
  width: 50px;
  height: 60px;
  text-align: center;
  font-size: 2em;
  font-weight: bold;
  border: 3px solid #e0e0e0;
  border-radius: 12px;
  transition: all 0.3s;
}

.code-digit:focus {
  outline: none;
  border-color: #ff9800;
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
  transform: scale(1.05);
}

.hint {
  color: #999;
  font-size: 0.9em;
  margin-top: 8px;
}

/* 成功頁面 */
.success-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.code-display {
  text-align: center;
  margin-bottom: 32px;
}

.code-display label {
  display: block;
  font-size: 0.9em;
  color: #666;
  margin-bottom: 12px;
}

.code-value {
  font-size: 3em;
  font-weight: bold;
  color: #f57c00;
  letter-spacing: 8px;
  margin: 16px 0;
  font-family: 'Courier New', monospace;
}

.copy-btn {
  background: #ff9800;
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s;
}

.copy-btn:hover {
  background: #f57c00;
  transform: translateY(-2px);
}

/* 便條資訊 */
.note-info {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.note-info h3 {
  margin-bottom: 12px;
  color: #f57c00;
}

.note-info ul {
  list-style: none;
}

.note-info li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.note-info li:last-child {
  border-bottom: none;
}

.note-info .label {
  font-weight: 600;
  color: #555;
}

/* 警告框 */
.warning-box {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 16px;
  border-radius: 8px;
}

.warning-box h3 {
  color: #856404;
  margin-bottom: 8px;
}

.warning-box ul {
  list-style: none;
  color: #856404;
}

.warning-box li {
  padding: 4px 0;
}

/* 確認頁面 */
.confirm-box {
  text-align: center;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 12px;
  margin-bottom: 24px;
}

.warning-icon {
  font-size: 4em;
  margin-bottom: 16px;
}

.burn-warning {
  background: #ffe5e5;
  border: 2px solid #ff4444;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.burn-warning h3 {
  color: #cc0000;
  margin-bottom: 12px;
}

.burn-warning p {
  color: #cc0000;
  margin: 8px 0;
}

.normal-info {
  color: #28a745;
  font-size: 1.1em;
  margin: 20px 0;
}

/* 顯示頁面 */
.display-box {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.note-content {
  background: white;
  padding: 24px;
  border-radius: 8px;
  min-height: 150px;
  font-size: 1.1em;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.status-box {
  margin-bottom: 24px;
}

.burn-status-box {
  background: #ffe5e5;
  border: 2px solid #ff4444;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.burn-icon {
  font-size: 3em;
  margin-bottom: 12px;
}

.burn-status-box h3 {
  color: #cc0000;
  margin-bottom: 12px;
}

.burn-status-box p {
  color: #cc0000;
  margin: 8px 0;
}

.info-status-box {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 16px;
  border-radius: 8px;
  color: #2e7d32;
}

/* 查看按鈕（view-btn）*/
#view-btn {
  width: 100%;
  padding: 18px 32px;
  background: #ff9800;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.2em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
  margin-bottom: 16px;
}

#view-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 152, 0, 0.5);
  background: #fb8c00;
}

#view-btn:active:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

#view-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  box-shadow: none;
}

/* 按鈕組 */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}

.button {
  display: inline-block;
  padding: 14px 28px;
  background: #ff9800;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(255, 152, 0, 0.4);
}

.button.secondary {
  background: #6c757d;
}

.button.secondary:hover {
  background: #5a6268;
}

.link-button {
  display: inline-block;
  color: #f57c00;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 0;
  transition: color 0.3s;
}

.link-button:hover {
  color: #e65100;
  text-decoration: underline;
}

/* 密碼輸入框樣式 */
.password-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.password-length-select {
  width: 120px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s;
}

.password-length-select:focus {
  outline: none;
  border-color: #ff9800;
}

.password-input {
  flex: 1;
  padding: 14px 16px;
  font-size: 1.3em;
  font-weight: 600;
  text-align: center;
  letter-spacing: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  transition: all 0.3s;
  background: white;
}

.password-input:focus {
  outline: none;
  border-color: #ff9800;
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
  transform: scale(1.02);
}

.password-input::placeholder {
  letter-spacing: normal;
  font-size: 0.8em;
  font-weight: normal;
  color: #999;
}

/* 密碼提示文字 */
.password-hint {
  font-size: 0.9em;
  color: #666;
  margin-top: 8px;
  line-height: 1.4;
}

/* 選項提示文字（互斥說明）*/
.option-hint {
  font-size: 0.85em;
  color: #888;
  margin: 4px 0 0 28px;
  line-height: 1.3;
}

/* 錯誤訊息框 */
.error-message {
  background: #ffebee;
  border-left: 4px solid #f44336;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease-out;
}

.error-message.hidden {
  display: none;
}

.error-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.error-message p {
  margin: 0;
  color: #c62828;
  font-weight: 500;
  line-height: 1.4;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 成功訊息框 */
.success-message {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease-out;
}

.success-message.hidden {
  display: none;
}

.success-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.success-message p {
  margin: 0;
  color: #2e7d32;
  font-weight: 500;
  line-height: 1.4;
}

/* 密碼區塊樣式 */
.password-section {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.password-section h3 {
  color: #f57c00;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-section p {
  color: #555;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* 確認頁面的密碼輸入框（更大更明顯）*/
.password-section .password-input {
  width: 100%;
  padding: 16px;
  font-size: 1.5em;
  letter-spacing: 10px;
  border: 3px solid #ff9800;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.password-section .password-input:focus {
  border-color: #f57c00;
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3);
}

/* 響應式設計 */
@media (max-width: 640px) {
  .container {
    padding: 24px;
  }

  h1 {
    font-size: 2em;
  }

  button[type="submit"] {
    font-size: 1em;
  }

  .code-digit {
    width: 40px;
    height: 50px;
    font-size: 1.5em;
  }

  .code-value {
    font-size: 2em;
    letter-spacing: 4px;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .password-input-wrapper {
    flex-direction: column;
    gap: 12px;
  }

  .password-length-select {
    width: 100%;
  }

  .password-input {
    font-size: 1.2em;
    letter-spacing: 6px;
  }

  .password-section .password-input {
    font-size: 1.3em;
    letter-spacing: 8px;
    padding: 14px;
  }
}
