/* 小红书风格样式 */
:root {
  --xhs-red: #FE2C55;
  --xhs-pink: #FF2E4D;
  --xhs-light-pink: #FFE8EC;
  --xhs-gray: #666666;
  --xhs-light-gray: #F8F8F8;
  --xhs-black: #333333;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--xhs-black);
  background-color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 导航栏样式 */
.navbar {
  background-color: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  color: var(--xhs-red) !important;
  font-weight: 600;
  font-size: 1.25rem;
}

.nav-link {
  color: var(--xhs-black) !important;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--xhs-red) !important;
}

.nav-item.active .nav-link {
  color: var(--xhs-red) !important;
}

/* 主要内容区域 */
.main-content {
  margin-top: 80px;
  padding: 20px 0;
  flex: 1 0 auto;
}

/* 卡片样式 */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card-body {
  padding: 24px;
}

/* 按钮样式 */
.btn-primary {
  background-color: var(--xhs-red);
  border-color: var(--xhs-red);
  font-weight: 500;
  border-radius: 8px;
  padding: 10px 20px;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #e62a4d;
  border-color: #e62a4d;
  box-shadow: 0 2px 8px rgba(254, 44, 85, 0.3);
}

.btn-warning {
  background-color: #FF9500;
  border-color: #FF9500;
  color: white;
  font-weight: 500;
  border-radius: 8px;
  padding: 10px 20px;
}

.btn-warning:hover, .btn-warning:focus {
  background-color: #F08200;
  border-color: #F08200;
  color: white;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
}

.btn-outline-primary {
  color: var(--xhs-red);
  border-color: var(--xhs-red);
}

.btn-outline-primary:hover {
  background-color: var(--xhs-red);
  border-color: var(--xhs-red);
}

/* 表单元素样式 */
.form-control {
  border-radius: 8px;
  border: 1px solid #E8E8E8;
  padding: 12px;
  width: 100%;
  word-break: break-all;
  white-space: pre-wrap;
}

/* 下拉框特殊样式 */
select.form-control {
  height: auto;
  padding: 12px;
  white-space: normal;
  word-break: normal;
  -webkit-appearance: menulist;
  appearance: menulist;
}

select.form-control option {
  padding: 8px;
  white-space: normal;
  min-height: 1.2em;
  background: white;
}

.form-control:focus {
  border-color: var(--xhs-red);
  box-shadow: 0 0 0 0.2rem rgba(254, 44, 85, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
  font-size: 14px;
}

/* 隐藏码输入框 */
#text-key {
  display: none;
}

/* 标题样式 */
h1, h2, .h1, .h2 {
  font-weight: 600;
  color: var(--xhs-black);
}

.display-4 {
  font-size: 2.5rem;
  font-weight: 600;
}

/* 警告框样式 */
.alert {
  border-radius: 8px;
  border: none;
}

.alert-danger {
  background-color: var(--xhs-light-pink);
  color: var(--xhs-red);
}

.alert-success {
  background-color: #E8F8F0;
  color: #00B578;
}

.alert.hide {
  display: none;
}

/* 模态框样式 */
.modal-content {
  border-radius: 12px;
  border: none;
}

.modal-header {
  border-bottom: 1px solid #F0F0F0;
}

.modal-footer {
  border-top: 1px solid #F0F0F0;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .main-content {
    margin-top: 70px;
    padding: 15px;
  }
  
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  textarea.form-control {
    font-size: 14px;
  }
  
  /* 只让主要按钮是全宽的 */
  .btn-block {
    width: 100%;
    margin-bottom: 10px;
  }
  
  /* 复制按钮保持原有大小 */
  .btn-sm {
    width: auto;
    margin-bottom: 0;
  }
  
  .display-4 {
    font-size: 2rem;
  }
}

/* 页样式 */
.footer {
  flex-shrink: 0;
  width: 100%;
  padding: 20px 0;
  background-color: var(--xhs-light-gray);
  text-align: center;
  margin-top: auto;
}

.footer .text-muted {
  color: var(--xhs-gray) !important;
}

/* 链接样式 */
a {
  color: var(--xhs-red);
  text-decoration: none;
}

a:hover {
  color: #e62a4d;
  text-decoration: none;
}

/* 只读文本框样式 */
textarea[readonly] {
  background-color: var(--xhs-light-gray);
  cursor: text;
  word-break: break-all;
  white-space: pre-wrap;
}

/* 小型按钮样式 */
.btn-sm {
  padding: 4px 12px;
  font-size: 0.875rem;
  border-radius: 4px;
  min-width: 80px;
}

.btn-sm .fas {
  font-size: 0.875rem;
  margin-right: 4px;
}

/* 结果区域标题和按钮布局 */
.form-group label {
  margin-bottom: 0;
  font-size: 14px;
}

.form-group .d-flex {
  margin-bottom: 8px;
}

/* 首页特殊样式 */
body.text-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.text-center > .container {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* 页脚样式 */
.footer {
  flex-shrink: 0;
  width: 100%;
  padding: 20px 0;
  background-color: var(--xhs-light-gray);
  text-align: center;
}

/* 首页卡片容器样式 */
.row.justify-content-center.align-items-stretch {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* 首页标题区域样式 */
.header.my-5 {
  margin-top: 0 !important;
}