:root {
  --brand-orange: #ff9800;
  --brand-green: #4caf50;
  --brand-blue: #2196f3;
  --text-dark: #2c3e50;
  --text-muted: #7f8c8d;
  --bg-body: #f4f7fa;
  --card-bg: #ffffff;
  --border-soft: #edf2f7;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dark);
  background-color: var(--bg-body);
}

a {
  text-decoration: none;
  color: var(--brand-green);
  transition: var(--transition);
}

a:hover {
  color: #35a045;
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

.tips-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.tips-header {
  text-align: center;
  padding: 40px 20px 30px;
}

.tips-logo {
  height: 32px;
  margin-bottom: 16px;
}

.tips-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.tips-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.tips-nav {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tips-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 4px;
    justify-content: center;
}

.tips-nav-tab {
  flex-shrink: 0;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-muted);
  background: transparent;
  border-radius: 25px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.tips-nav-tab:hover {
  background: rgba(76, 175, 80, 0.08);
  color: var(--brand-green);
  text-decoration: none;
}

.tips-nav-tab.active {
  background: var(--brand-green);
  color: white;
  font-weight: 600;
  border-color: var(--brand-green);
}

.tips-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tips-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-soft);
  transition: var(--transition);
  cursor: pointer;
}

.tips-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--brand-green);
}

.tips-card-id {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(76, 175, 80, 0.1);
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  margin-bottom: 12px;
}

.tips-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.6;
}

.tips-card:hover .tips-card-title {
  color: var(--brand-green);
}

.tips-card-link:hover {
  text-decoration: none;
}

.tips-detail {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-soft);
}

.tips-detail-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.tips-detail-id {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--brand-green), #45a049);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 16px;
}

.tips-detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.5;
}

.tips-detail-body {
  color: var(--text-dark);
  font-size: 15px;
  line-height: 2;
}

.tips-detail-body p {
  margin-bottom: 16px;
}

.tips-detail-body h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 24px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--brand-green);
}

.tips-detail-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.tips-detail-body ol li {
  list-style: decimal;
  margin-bottom: 12px;
  padding-left: 8px;
}

.tips-detail-body ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.tips-detail-body ul li {
  list-style: disc;
  margin-bottom: 8px;
  padding-left: 8px;
}

.tips-detail-body strong {
  color: var(--text-dark);
  font-weight: 600;
}

.tips-detail-body .formulae {
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(76, 175, 80, 0.08);
}

.tips-detail-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

.tips-detail-footer .tips-detail-box {
  padding: 16px 20px;
  background: rgba(76, 175, 80, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--brand-green);
  margin-bottom: 16px;
}

.tips-detail-footer .tips-detail-box p {
  margin-bottom: 8px;
  color: var(--text-dark);
}

.tips-detail-footer .tips-detail-box p:last-child {
  margin-bottom: 0;
}

.tips-detail-footer .tips-detail-box a {
  word-break: break-all;
  color: var(--brand-green);
}

.tips-action {
  margin-top: 24px;
  text-align: center;
}

.tips-action a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 25px;
  color: var(--text-muted);
  font-size: 14px;
  transition: var(--transition);
}

.tips-action a:hover {
  background: var(--brand-green);
  color: white;
  border-color: var(--brand-green);
  text-decoration: none;
}

.tips-related {
  margin-top: 32px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-soft);
}

.tips-related-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.tips-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.tips-related-item {
  padding: 12px 16px;
  background: rgba(76, 175, 80, 0.03);
  border-radius: 8px;
  transition: var(--transition);
}

.tips-related-item:hover {
  background: rgba(76, 175, 80, 0.08);
}

.tips-related-item a {
  display: block;
  color: var(--text-dark);
  font-size: 14px;
}

.tips-related-item a:hover {
  color: var(--brand-green);
  text-decoration: none;
}

.tips-footer {
  margin-top: 60px;
  text-align: center;
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-soft);
}

.tips-footer a {
  color: var(--text-muted);
}

.tips-footer a:hover {
  color: var(--brand-green);
}

@media (max-width: 760px) {
  .tips-container {
    padding: 16px;
  }

  .tips-header {
    padding: 30px 10px 20px;
  }

  .tips-title {
    font-size: 20px;
  }

  .tips-nav {
    padding: 16px 12px;
    border-radius: 12px;
  }

  .tips-nav-tabs {
    justify-content: flex-start;
  }

  .tips-nav-tab {
    padding: 8px 12px;
    font-size: 13px;
    flex: 0 0 auto;
  }

  .tips-content {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tips-card {
    padding: 16px;
  }

  .tips-detail {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .tips-detail-title {
    font-size: 18px;
  }

  .tips-detail-body {
    font-size: 14px;
    line-height: 1.8;
  }

  .tips-related-list {
    grid-template-columns: 1fr;
  }

  .tips-action a {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #12141a;
    --card-bg: #1c1f26;
    --bg-gray: #252932;
    --text-dark: #e2e8f0;
    --text-muted: #94a3b8;
    --border-soft: #2d333f;
    --brand-green: #4ade80;
    --brand-green-light: rgba(74, 222, 128, 0.15);
    --brand-blue: #60a5fa;
    --brand-orange: #fbbf24;
  }

  .tips-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }

  .tips-detail {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .tips-nav-tab {
    color: var(--text-muted);
  }

  .tips-nav-tab.active {
    background: var(--brand-green);
    color: #000;
    border-color: var(--brand-green);
  }

  .tips-detail-body .formulae {
    background: rgba(74, 222, 128, 0.15);
    color: var(--text-dark);
  }

  .tips-detail-footer .tips-detail-box {
    background: rgba(74, 222, 128, 0.1);
  }

  .tips-related-item {
    background: rgba(74, 222, 128, 0.08);
  }

  .tips-related-item:hover {
    background: rgba(74, 222, 128, 0.15);
  }

  .tips-action a {
    background: var(--card-bg);
    border-color: var(--border-soft);
  }

  .tips-action a:hover {
    background: var(--brand-green);
    color: #000;
  }
}

/* ==================== 全站一级导航栏（与 hp/styles/app.css 一致） ==================== */
.head-mobile {
    display: flex;
    flex-direction: column;
    padding: 0 8px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-soft);
}

.logo-wrapper {
    padding: 6px 8px;
    text-align: center;
    text-decoration: none;
}

.logo-wrapper .logo {
    height: 23px;
}

.logo-slogan {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    text-align: center;
    display: none;
}

.search {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
}

.search .search-input {
    width: 100%;
    height: 28px;
    background-color: #fff;
    border-radius: 14px;
    border: 1px solid #cdcdcd;
    padding: 0 10px;
    box-sizing: border-box;
    position: relative;
}

.search .search-input input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    background-color: transparent;
    padding-left: 20px;
    padding-right: 60px;
    height: 100%;
}

.search .search-input input::placeholder {
    color: #cdcdcd;
}

.search .search-input .search-button {
    width: 60px;
    height: 28px;
    background-color: #4caf50;
    border-radius: 24px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    line-height: 28px;
    position: absolute;
    right: 0;
    top: 0;
}

.search .search-input .search-icon {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
}

.search .login {
    white-space: nowrap;
    font-size: 14px;
    text-align: center;
    line-height: 28px;
    right: 0;
    top: 0;
    height: 28px;
    cursor: pointer;
    color: #333;
    margin-left: 20px;
    padding-right: 10px;
    text-decoration: none;
}

.search .login:hover {
    color: #35B058;
}

/* 导航栏激活状态 */
.navi-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    min-height: 34px;
    margin-top: 8px;
}

.navi-bar-item {
    text-align: center;
    line-height: 100%;
    height: 100%;
    min-height: 34px;
    font-size: 12px;
    color: #333;
    /* 不允许换行 */
    white-space: nowrap;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.navi-bar-item a {
    text-decoration: none;
    color: inherit;
}

.navi-bar-item.active {
    color: #35B058;
}

.navi-bar-item.active::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: #35B058;
    position: absolute;
    bottom: 0;
}

/* PC端自适应布局（与 hp/styles/app.pc.css 一致） */
@media (min-width: 768px) {
    .head-mobile {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        height: 60px;
    }

    .logo-wrapper {
        display: flex;
        align-items: center;
        margin-bottom: 0px;
        gap: 12px;
        order: 1;
    }

    .logo-wrapper .logo {
        width: auto;
        max-width: 200px;
    }

    .head-mobile .navi-bar {
        flex: 1;
        margin-top: 0;
        max-width: 646px;
        order: 2;
    }

    .head-mobile .search {
        order: 3;
        min-width: 140px;
        margin-top: 0px;
    }

    .search .search-input {
        width: auto;
    }

    .navi-bar-item {
        font-size: 14px;
    }
}

/* 屏幕宽度大于1300px时显示slogan */
@media (min-width: 1300px) {
    .logo-slogan {
        display: block;
        color: #828282;
        margin-left: 10px;
        position: relative;
        margin-top: 0;
        font-size: 14px;
        white-space: nowrap;
    }

    .logo-slogan::before {
        content: '';
        display: block;
        width: 1px;
        height: 17px;
        background-color: #BDBDBD;
        position: absolute;
        left: -10px;
        top: 2px;
    }
}

/* 深色模式导航栏 */
@media (prefers-color-scheme: dark) {
  .search .search-input {
    background-color: var(--bg-gray);
    border-color: var(--border-soft);
  }

  .search .search-input input {
    color: var(--text-dark);
  }

  .search .search-input input::placeholder {
    color: var(--text-muted);
  }

  .logo-slogan {
    color: var(--text-muted);
  }
}
