/*
 * 网安柜 (Websafe Locker) - Claude Code 风格 UI (融合桃花主题)
 * 现代化AI工具界面设计，同时保留桃花意境配色
 */

/* 重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #3D3435;
  background: linear-gradient(135deg, #FFF9F9 0%, #FDF0F2 20%, #F8E4E8 40%, #F0D9E0 60%, #F8E4E8 80%, #FFF9F9 100%);
  background-size: 400% 400%;
  animation: gradientShift 25s ease infinite;
  min-height: 100vh;
  padding-bottom: 20px;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  33% { background-position: 50% 50%; }
  66% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 容器布局 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 页眉设计 */
header#commonHeader {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #3D3435;
  padding: 15px 0;
  box-shadow: 0 2px 20px rgba(212, 138, 152, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(212, 138, 152, 0.1);
}

.logo a {
  text-decoration: none;
  color: #3D3435;
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, color 0.3s ease;
  letter-spacing: 0.5px;
}

.logo a:hover {
  transform: scale(1.05);
  color: #D48A98;
}

.logo i {
  margin-right: 12px;
  font-size: 26px;
  color: #D48A98;
}

.info-box {
  text-align: right;
  line-height: 50px;
  font-size: 14px;
  color: #6B7280;
}

/* 主要内容区 */
main#app {
  padding: 30px 0;
  display: flex;
  justify-content: center;
}

#appBox {
  width: 100%;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 35px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(212, 138, 152, 0.1), 0 0 80px rgba(212, 138, 152, 0.05);
  margin-top: 20px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  border: 1px solid rgba(212, 138, 152, 0.1);
}

#appBox:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 50px rgba(212, 138, 152, 0.15), 0 0 100px rgba(212, 138, 152, 0.08);
}

/* 匿名模式特殊样式 */
.anonymous-mode {
  border: 2px solid #D48A98;
  background: linear-gradient(135deg, rgba(248, 215, 218, 0.04), rgba(232, 180, 192, 0.08));
  box-shadow: 0 0 30px rgba(212, 138, 152, 0.1);
}

.anonymous-badge {
  background: #D48A98;
  color: white;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  margin-left: 10px;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(212, 138, 152, 0.2);
}

/* 柜区域 */
textarea#noteArea {
  width: 100%;
  min-height: 400px;
  border: 1px solid rgba(212, 138, 152, 0.2);
  padding: 20px;
  font-size: 16px;
  resize: vertical;
  outline: none;
  border-radius: 8px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: #FFFFFF;
  line-height: 1.6;
  box-shadow: inset 0 1px 2px rgba(212, 138, 152, 0.05);
  color: #3D3435;
}

textarea#noteArea:focus {
  border-color: #D48A98;
  box-shadow: 0 0 0 3px rgba(212, 138, 152, 0.15);
  background-color: #FEFEFF;
}

textarea#noteArea::placeholder {
  color: rgba(61, 52, 53, 0.5);
}

/* 按钮组 */
.button-group {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  margin: 0;
  background: #D48A98;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
  text-align: center;
  min-width: 100px;
  box-shadow: 0 1px 2px rgba(212, 138, 152, 0.2);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 138, 152, 0.3);
  background: #C97B8A;
}

.btn:active {
  transform: translateY(0);
}

.btn-success {
  background: #B5D3B4;
  box-shadow: 0 1px 2px rgba(181, 211, 180, 0.2);
}

.btn-success:hover {
  background: #A4C7A3;
  box-shadow: 0 4px 12px rgba(181, 211, 180, 0.3);
}

.btn-warning {
  background: #F0C4C8;
  box-shadow: 0 1px 2px rgba(240, 196, 200, 0.2);
}

.btn-warning:hover {
  background: #E8B4C0;
  box-shadow: 0 4px 12px rgba(240, 196, 200, 0.3);
}

.btn-danger {
  background: #B88A8A;
  box-shadow: 0 1px 2px rgba(184, 138, 138, 0.2);
}

.btn-danger:hover {
  background: #AB7B7B;
  box-shadow: 0 4px 12px rgba(184, 138, 138, 0.3);
}

.btn-primary {
  background: #D48A98;
  box-shadow: 0 1px 2px rgba(212, 138, 152, 0.2);
}

.btn-primary:hover {
  background: #C97B8A;
  box-shadow: 0 4px 12px rgba(212, 138, 152, 0.3);
}

/* 文件上传 */
.file-upload {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.file-input {
  display: none;
}

.file-label {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #B5D3B4;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(181, 211, 180, 0.2);
  font-weight: 500;
}

.file-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(181, 211, 180, 0.3);
}

/* 状态栏 */
.status-bar {
  text-align: center;
  color: #3D3435;
  font-size: 14px;
  margin-top: 15px;
  padding: 12px 20px;
  background: rgba(248, 215, 218, 0.2);
  backdrop-filter: blur(5px);
  border-radius: 8px;
  border: 1px solid rgba(212, 138, 152, 0.15);
  box-shadow: inset 0 1px 2px rgba(212, 138, 152, 0.05);
}

/* 通知 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 24px;
  background: #D48A98;
  color: white;
  border-radius: 8px;
  display: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(212, 138, 152, 0.25);
  animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  font-weight: 500;
}

@keyframes slideIn {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.notification.error {
  background: #B88A8A;
  box-shadow: 0 4px 12px rgba(184, 138, 138, 0.3);
}

.notification.warning {
  background: #F0C4C8;
  box-shadow: 0 4px 12px rgba(240, 196, 200, 0.3);
  color: #3D3435;
}

/* 页脚 */
footer {
  background: rgba(248, 215, 218, 0.3);
  color: #3D3435;
  margin-top: 40px;
  padding: 30px 0 20px;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -2px 20px rgba(212, 138, 152, 0.1);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.copyright {
  color: rgba(61, 52, 53, 0.85);
  margin-bottom: 15px;
  text-align: center;
  font-weight: 500;
}

.footer-nav {
  margin-bottom: 15px;
  text-align: center;
}

.footer-nav a {
  color: #3D3435;
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.3s;
}

.footer-nav a:hover {
  color: #D48A98;
  text-decoration: underline;
}

.friend-link {
  font-size: 14px;
  color: rgba(61, 52, 53, 0.75);
  text-align: center;
}

.friend-link a {
  color: rgba(61, 52, 53, 0.75);
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.3s;
}

.friend-link a:hover {
  color: #D48A98;
}

/* 特色功能区域 */
.feature-box {
  background: rgba(248, 215, 218, 0.1);
  backdrop-filter: blur(5px);
  padding: 20px;
  border-radius: 8px;
  margin: 15px 0;
  border-left: 3px solid #D48A98;
  box-shadow: 0 1px 3px rgba(212, 138, 152, 0.1);
  transition: all 0.2s ease;
}

.feature-box:hover {
  box-shadow: 0 4px 12px rgba(212, 138, 152, 0.15);
  transform: translateY(-1px);
}

.feature-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: #3D3435;
  font-size: 16px;
  display: flex;
  align-items: center;
}

.feature-title i {
  margin-right: 8px;
  color: #D48A98;
}

/* 标签页容器 */
.tab-container {
  margin: 20px 0;
}

.tab-header {
  display: flex;
  border-bottom: 1px solid rgba(212, 138, 152, 0.2);
  margin-bottom: 20px;
  background: rgba(248, 215, 218, 0.1);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.tab-btn {
  padding: 12px 24px;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin: 0;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  color: #6B7280;
  flex: 1;
  text-align: center;
  position: relative;
}

.tab-btn:hover {
  background: rgba(248, 215, 218, 0.2);
  color: #D48A98;
}

.tab-btn.active {
  background: rgba(212, 138, 152, 0.1);
  color: #D48A98;
  border-bottom: 2px solid #D48A98;
}

.tab-content {
  display: none;
  padding: 20px;
  background: rgba(255, 249, 247, 0.5);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 1px 2px rgba(212, 138, 152, 0.05);
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* 历史记录列表 */
.history-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid rgba(212, 138, 152, 0.15);
  padding: 15px;
  border-radius: 8px;
  background: rgba(255, 249, 247, 0.5);
  margin-top: 15px;
  box-shadow: inset 0 1px 2px rgba(212, 138, 152, 0.05);
}

.history-item {
  padding: 12px;
  border-bottom: 1px solid rgba(212, 138, 152, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin-bottom: 5px;
  color: #3D3435;
}

.history-item:hover {
  background: rgba(248, 215, 218, 0.2);
  transform: translateX(3px);
}

.history-item:last-child {
  border-bottom: none;
}

/* 过期选项 */
.expiry-options {
  margin: 15px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.expiry-options label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}

.expiry-options label:hover {
  background: rgba(248, 215, 218, 0.2);
}

.expiry-options input[type="radio"] {
  margin-right: 6px;
}

/* 密码框 */
.password-box {
  display: none;
  margin: 15px 0;
  padding: 16px;
  background: rgba(248, 215, 218, 0.1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(212, 138, 152, 0.15);
  border-radius: 8px;
  animation: slideDown 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 1px 3px rgba(212, 138, 152, 0.1);
}

@keyframes slideDown {
  from { max-height: 0; opacity: 0; transform: translateY(-5px); }
  to { max-height: 300px; opacity: 1; transform: translateY(0); }
}

.password-input {
  width: 100%;
  padding: 10px 14px;
  margin: 8px 0;
  border: 1px solid rgba(212, 138, 152, 0.15);
  border-radius: 6px;
  transition: all 0.2s ease;
  background: #FFFFFF;
  color: #3D3435;
}

.password-input:focus {
  border-color: #D48A98;
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 138, 152, 0.15);
}

/* 分享链接框 */
.share-link-box {
  margin: 20px 0;
  padding: 20px;
  background: rgba(248, 215, 218, 0.15);
  backdrop-filter: blur(5px);
  border-radius: 8px;
  display: none;
  animation: slideInUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 1px solid rgba(212, 138, 152, 0.15);
  box-shadow: 0 1px 3px rgba(212, 138, 152, 0.1);
}

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

.share-link {
  width: 100%;
  padding: 10px 14px;
  margin: 10px 0;
  border: 1px solid rgba(212, 138, 152, 0.15);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #FFFFFF;
  color: #3D3435;
}

.share-link:focus {
  border-color: #D48A98;
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 138, 152, 0.15);
}

/* 同步指示器 */
.sync-indicator {
  float: right;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
}

.sync-local {
  background: rgba(181, 211, 180, 0.3);
  color: #3D3435;
  border: 1px solid rgba(181, 211, 180, 0.5);
}

.sync-server {
  background: rgba(232, 180, 192, 0.15);
  color: #D48A98;
  border: 1px solid rgba(232, 180, 192, 0.25);
}

/* 代码模式 */
.code-mode {
  font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
  line-height: 1.5;
  background-color: #FFF9F9;
  border: 1px solid rgba(212, 138, 152, 0.15);
  color: #3D3435;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  #appBox {
    padding: 20px;
    margin: 10px;
  }

  .button-group {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }

  .grid-x {
    flex-direction: column;
  }

  .cell {
    width: 100%;
    margin-bottom: 10px;
  }

  .info-box {
    text-align: center;
    margin-top: 10px;
  }

  textarea#noteArea {
    min-height: 300px;
  }

  .expiry-options {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .tab-header {
    overflow-x: auto;
    flex-wrap: wrap;
  }

  .tab-btn {
    min-width: 100px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .tab-container {
    margin: 15px 0;
  }

  .feature-box {
    padding: 15px;
  }

  .file-upload {
    flex-direction: column;
    align-items: stretch;
  }

  .file-label {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0 10px;
  }

  header#commonHeader {
    padding: 10px 0;
  }

  .logo a {
    font-size: 18px;
    justify-content: center;
  }

  .logo i {
    display: none;
  }

  #appBox {
    padding: 15px;
  }

  .status-bar {
    font-size: 12px;
    padding: 10px;
  }

  .tab-btn {
    padding: 10px 15px;
    font-size: 14px;
  }

  .button-group {
    gap: 8px;
  }

  .btn {
    padding: 8px 15px;
    font-size: 13px;
  }
}

/* 动画和过渡效果 */
.loading {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

.slide-in {
  animation: slideIn 0.3s ease;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .loading {
    animation: none;
  }
}

/* 打印样式 */
@media print {
  header, footer, .notification {
    display: none;
  }

  body {
    background: white;
    padding: 0;
  }

  #appBox {
    box-shadow: none;
    margin: 0;
    border-radius: 0;
  }
}

/* 网格系统增强 */
.grid-x {
  display: flex;
  flex-wrap: wrap;
}

.cell {
  flex: 1;
  padding: 0 10px;
}

.cell.small-12 {
  flex: 0 0 100%;
}

.cell.medium-4 {
  flex: 0 0 33.3333%;
}

.cell.medium-8 {
  flex: 0 0 66.6666%;
}

@media (max-width: 768px) {
  .cell.medium-4,
  .cell.medium-8 {
    flex: 0 0 100%;
  }
}

/* 特殊页面样式调整 */
main#app.full-height {
  min-height: calc(100vh - 200px);
  align-items: center;
}

#appBox.full-width {
  max-width: 100%;
  width: 90%;
}

/* 输入框增强 */
input[type="text"],
input[type="password"],
input[type="file"] {
  padding: 10px 14px;
  border: 1px solid rgba(212, 138, 152, 0.15);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  background: #FFFFFF;
  color: #3D3435;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: #D48A98;
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 138, 152, 0.15);
}

/* 选择框样式 */
select {
  padding: 10px 14px;
  border: 1px solid rgba(212, 138, 152, 0.15);
  border-radius: 6px;
  background-color: #FFFFFF;
  font-size: 14px;
  cursor: pointer;
  color: #3D3435;
}

select:focus {
  border-color: #D48A98;
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 138, 152, 0.15);
}

/* 复选框和单选框样式 */
input[type="checkbox"],
input[type="radio"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
}

/* 代码编辑器样式 */
.code-editor {
  font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
  line-height: 1.5;
  background-color: #FFF9F9;
  border: 1px solid rgba(212, 138, 152, 0.15);
  border-radius: 4px;
  padding: 15px;
  overflow: auto;
  font-size: 14px;
  color: #3D3435;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(240, 196, 200, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 138, 152, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 138, 152, 0.35);
}

/* Details/Summary 折叠样式 */
details {
  transition: all 0.2s ease;
}

details[open] {
  padding: 10px;
}

details summary {
  list-style: none;
  position: relative;
  padding-left: 25px;
  cursor: pointer;
  color: #3D3435;
  font-weight: 500;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '▶';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #D48A98;
  transition: transform 0.2s ease;
}

details[open] summary::before {
  transform: translateY(-50%) rotate(90deg);
}

/* Claude Code 风格特殊样式 */
.claude-code-container {
  border: 1px solid rgba(212, 138, 152, 0.2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(212, 138, 152, 0.1), 0 2px 4px -1px rgba(212, 138, 152, 0.05);
}

.claude-code-header {
  background: rgba(248, 215, 218, 0.1);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(212, 138, 152, 0.15);
  font-weight: 600;
  color: #3D3435;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.claude-code-body {
  padding: 16px;
  background: #FFFFFF;
}

.claude-code-footer {
  background: rgba(248, 215, 218, 0.1);
  padding: 12px 16px;
  border-top: 1px solid rgba(212, 138, 152, 0.15);
  color: #6B7280;
  font-size: 14px;
}

/* AI 助手风格按钮 */
.btn-ai {
  background: linear-gradient(135deg, #D48A98, #C97B8A);
  box-shadow: 0 1px 2px rgba(212, 138, 152, 0.2);
}

.btn-ai:hover {
  background: linear-gradient(135deg, #C97B8A, #BD6C7A);
  box-shadow: 0 4px 12px rgba(212, 138, 152, 0.3);
}

/* 智能提示框 */
.smart-tip {
  background: rgba(240, 196, 200, 0.1);
  border-left: 4px solid #D48A98;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 15px 0;
  color: #3D3435;
  font-size: 14px;
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.badge-primary {
  background: rgba(212, 138, 152, 0.15);
  color: #3D3435;
}

.badge-success {
  background: rgba(181, 211, 180, 0.15);
  color: #3D3435;
}

.badge-warning {
  background: rgba(240, 196, 200, 0.15);
  color: #3D3435;
}

.badge-danger {
  background: rgba(184, 138, 138, 0.15);
  color: #3D3435;
}