/* ===== 星途源码仓库 · 全局美化 ===== */

/* 覆盖主题主色为现代蓝（浅色模式） */
@media (prefers-color-scheme: light) {
  :root {
    --color-primary: #1f4ba8;
    --color-primary-contrast: #ffffff;
    --color-primary-dark-1: #2e6fd0;
    --color-primary-dark-2: #1a3f8f;
    --color-primary-dark-3: #16346f;
    --color-primary-hover: #2e6fd0;
    --color-primary-active: #1a3f8f;
    --color-primary-light-1: #4b7bec;
    --color-primary-light-2: #6b96f0;
    --color-primary-light-5: #c3d4f6;
    --color-primary-light-6: #e8effd;
    --color-primary-light-7: #f2f6ff;
    --color-primary-alpha-10: #1f4ba81a;
    --color-primary-alpha-20: #1f4ba833;
    --color-primary-alpha-30: #1f4ba84d;
    --color-primary-alpha-40: #1f4ba866;
    --color-primary-alpha-50: #1f4ba880;
    --color-primary-alpha-60: #1f4ba899;
    --color-primary-alpha-70: #1f4ba8b3;
    --color-primary-alpha-80: #1f4ba8cc;
    --color-primary-alpha-90: #1f4ba8e6;
    --color-link: #1f4ba8;
    --color-link-hover: #2e6fd0;
  }
}

/* ===== 顶部导航美化 ===== */
#navbar {
  background: rgba(255,255,255,.97) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e7ebf2 !important;
  box-shadow: 0 1px 12px rgba(15,42,107,.06);
}
#navbar .item { border-radius: 8px; color: #3b4252; }
#navbar .item:hover { background: #eef2fb; color: #1f4ba8; }
#navbar .item.active { color: #1f4ba8; font-weight: 600; }

/* ===== 按钮美化 ===== */
.ui.button.primary, .ui.primary.button,
.ui.button.blue, .ui.blue.button {
  background: linear-gradient(135deg,#1f4ba8,#2e6fd0) !important;
  border-radius: 8px !important;
  box-shadow: 0 3px 10px rgba(31,75,168,.22);
  transition: all .18s;
}
.ui.button.primary:hover, .ui.primary.button:hover,
.ui.button.blue:hover { filter: brightness(1.08); box-shadow: 0 5px 14px rgba(31,75,168,.3); }

/* ===== 输入框/表单美化 ===== */
.ui.input input, .ui.form input, .ui.form textarea, .ui.form select,
.ui.search .ui.input input {
  border-radius: 8px !important;
}
.ui.input input:focus, .ui.form input:focus, .ui.form textarea:focus {
  border-color: #1f4ba8 !important;
  box-shadow: 0 0 0 3px rgba(31,75,168,.12) !important;
}

/* ===== 卡片/容器圆角阴影 ===== */
.ui.segment, .ui.card, .ui.attached.segment,
.ui.table, .repo-card, .ui.top.attached.segment {
  border-radius: 12px !important;
}
.ui.segment { box-shadow: 0 2px 10px rgba(15,42,107,.05) !important; }

/* ===== 标签页美化 ===== */
.ui.secondary.pointing.menu .active.item {
  color: #1f4ba8 !important;
  border-color: #1f4ba8 !important;
}

/* ===== 页脚美化 ===== */
.page-footer {
  border-top: 1px solid #e7ebf2;
  background: #fafbfd;
  color: #6b7280;
}

/* ===== 登录 / 注册页美化 ===== */
body:has(.page-content.user.sign-in),
body:has(.page-content.user.sign-up),
body { background: #f5f8ff; }
.user.sign-in, .user.sign-up,
.page-content.user.sign-in, .page-content.user.sign-up {
  background: linear-gradient(180deg,#eef2fb 0%,#ffffff 100%);
  padding-top: 20px;
}
.user.sign-in .ui.form, .user.sign-up .ui.form,
.user.sign-in .ui.attached.segment, .user.sign-up .ui.attached.segment {
  border-radius: 14px !important;
  box-shadow: 0 8px 30px rgba(15,42,107,.10) !important;
  border: 1px solid #e7ebf2;
}
.user.sign-in .ui.header, .user.sign-up .ui.header { color: #0f2a6b; }
.user.sign-in .ui.center.language, .user.sign-up .ui.center.language { color: #6b7280; }

/* ===== 仓库列表 / 探索页卡片 ===== */
.repo-card { border: 1px solid #e7ebf2; transition: all .2s; }
.repo-card:hover { box-shadow: 0 6px 18px rgba(31,75,168,.10); transform: translateY(-2px); }

/* ===== 弹窗/菜单圆角 ===== */
.ui.menu, .ui.dropdown .menu, .ui.popup { border-radius: 10px !important; }

/* ===== 账号/仓库主页 · likeadmin 风格 ===== */
.page-content.user.profile { background: #f5f8ff; }

/* 左侧资料卡 */
#profile-avatar-card {
  border-radius: 16px !important;
  border: 1px solid #e7ebf2 !important;
  box-shadow: 0 10px 30px rgba(15,42,107,.08) !important;
  overflow: hidden;
  background: #fff;
}
#profile-avatar-card .ui.avatar, #profile-avatar-card img.ui.avatar { border-radius: 14px; }
#profile-avatar-card .username { font-size: 22px; font-weight: 700; color: #0f2a6b; }
#profile-avatar-card .muted { color: #6b7280; font-size: 14px; }
#profile-avatar-card .extra.content li { color: #6b7280; }

/* 右侧 tabs 美化 */
.page-content.user.profile .ui.secondary.pointing.menu .active.item {
  color: #1f4ba8 !important;
  border-color: #1f4ba8 !important;
  font-weight: 600;
}

/* 仓库列表 → 项目卡片 (likeadmin 精选项目感) */
.page-content.user.profile .flex-item {
  background: #fff;
  border: 1px solid #e7ebf2;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15,42,107,.05);
  padding: 18px 22px;
  margin-bottom: 14px;
  transition: all .2s;
}
.page-content.user.profile .flex-item:hover {
  box-shadow: 0 10px 28px rgba(31,75,168,.12);
  transform: translateY(-3px);
  border-color: #c6d4f0;
}
.page-content.user.profile .flex-item-leading { color: #1f4ba8; }
.page-content.user.profile .flex-item-title .name {
  font-size: 18px; font-weight: 600; color: #1f4ba8;
}
.page-content.user.profile .flex-item-title .name:hover { text-decoration: underline; }
.page-content.user.profile .flex-item-trailing {
  color: #6b7280; font-size: 13px;
}
.page-content.user.profile .flex-item-trailing .color-icon {
  border-radius: 4px; width: 14px; height: 14px;
}
.page-content.user.profile .flex-item-body { color: #666; font-size: 13px; line-height: 1.7; }

/* 搜索/筛选框美化 */
.page-content.user.profile .ui.input input { border-radius: 8px !important; }

/* ===== 仓库详情页 · likeadmin 风格 ===== */
/* 仓库头部 */
.repo-header .flex-item-title,
.repo-header .tw-text-18,
.repo-header h1 { color: #0f2a6b !important; font-weight: 700; }
.repo-header .flex-item-title .text, .repo-header .name { color: #1f4ba8; }

/* Star / Fork 按钮 */
.repo-header .ui.basic.label {
  background: #fff !important;
  border: 1px solid #e7ebf2 !important;
  color: #6b7280 !important;
  border-radius: 8px !important;
  box-shadow: none;
}
.repo-header .ui.basic.label:hover { border-color: #1f4ba8 !important; color: #1f4ba8 !important; }
.repo-header .ui.labeled.button > .ui.button.primary,
.repo-header .ui.primary.button {
  background: linear-gradient(135deg,#1f4ba8,#2e6fd0) !important;
  border-radius: 8px 0 0 8px !important;
}

/* 仓库描述 */
.repo-description {
  color: #6b7280; font-size: 15px; margin: 6px 0 18px;
}

/* Tabs 美化 */
.repository-menu, .repo-menu,
.ui.tabular.menu, .ui.secondary.menu {
  border-bottom: 1px solid #e7ebf2 !important;
}
.ui.tabular.menu .item, .ui.secondary.menu .item { color: #6b7280; }
.ui.tabular.menu .active.item, .ui.secondary.menu .active.item {
  color: #1f4ba8 !important;
  border-color: #1f4ba8 !important;
  font-weight: 600;
}

/* 文件列表表格 → 卡片式 */
#repo-files-table {
  background: #fff !important;
  border-radius: 14px !important;
  border: 1px solid #e7ebf2 !important;
  box-shadow: 0 2px 10px rgba(15,42,107,.05);
  overflow: hidden;
}
#repo-files-table thead th {
  color: #6b7280; background: #fafbfd !important;
  border-bottom: 1px solid #e7ebf2 !important;
}
#repo-files-table tbody tr { transition: background .15s; }
#repo-files-table tbody tr:hover { background: #f4f8ff !important; }
#repo-files-table .repo-file-name, #repo-files-table .file-name { color: #1f4ba8; font-weight: 600; }
#repo-files-table .sha.label { border-radius: 6px; }

/* README 区块 */
.markdown-body { border-radius: 14px; border: 1px solid #e7ebf2; }
.repository-summary, .repo-header + .ui.segment { border-radius: 14px !important; }

/* ===== 仓库头部 likeadmin 增强（大标题+统计数字） ===== */
.repo-header { padding: 10px 0 6px; }
.repo-header .flex-item-title,
.repo-header .tw-text-18,
.repo-header .flex-item-title .text {
  font-size: 26px !important;
  font-weight: 700 !important;
  color: #0f2a6b !important;
  letter-spacing: .5px;
}
.repo-description {
  font-size: 16px !important;
  color: #5a6472 !important;
  margin: 8px 0 20px !important;
}
/* Star / Fork 统计数字 → 大而醒目 */
.repo-header .ui.labeled.button,
.repo-header .ui.basic.label {
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,42,107,.06);
}
.repo-header .ui.labeled.button > .ui.label,
.repo-header .ui.basic.label > .ui.label,
.repo-header .ui.labeled.button .ui.basic.label,
.repo-header .ui.label {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #1f4ba8 !important;
  background: #f4f8ff !important;
}
/* 订阅/Star 主按钮 */
.repo-header .ui.primary.button,
.repo-header .ui.button.primary {
  background: linear-gradient(135deg,#1f4ba8,#2e6fd0) !important;
}
/* 文件列表标题行更清晰 */
#repo-files-table tbody tr td:first-child { color: #1f4ba8; font-weight: 600; }

/* ===== 仓库头部 · likeadmin 三统计（模板注入 repo-stats） ===== */
.repo-header {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 6px;
}
.repo-stats { display: flex; gap: 10px; }
.repo-stats .stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 88px; padding: 9px 16px;
  background: #fff; border: 1px solid #e7ebf2; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15,42,107,.05);
  text-decoration: none; transition: all .15s ease;
}
.repo-stats .stat:hover { border-color: #1f4ba8; box-shadow: 0 5px 16px rgba(31,75,168,.16); transform: translateY(-1px); }
.repo-stats .stat .num { font-size: 22px; font-weight: 700; color: #1f4ba8; line-height: 1.1; }
.repo-stats .stat .lbl { font-size: 13px; color: #6b7280; margin-top: 3px; font-weight: 500; }
/* 原操作按钮区紧随统计，风格统一 */
.repo-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.repo-buttons .ui.button, .repo-buttons .ui.labeled.button { border-radius: 8px !important; }

/* ===== 「更多操作」三点图标 → 文字 ===== */
button.ui.small.jump.dropdown.icon.button > svg.octicon-kebab-horizontal { display: none !important; }
button.ui.small.jump.dropdown.icon.button[data-tooltip-content="More Operations"] {
  width: auto !important;
  padding: 0 10px !important;
  color: #1f4ba8 !important;
  background: #f4f8ff !important;
  border: 1px solid #dbe3f2 !important;
  border-radius: 8px !important;
}
button.ui.small.jump.dropdown.icon.button[data-tooltip-content="More Operations"]::before {
  content: "更多操作";
  font-size: 13px;
  font-weight: 500;
  margin-right: 2px;
}

/* ===== 「更多操作」三点 → 文字（:has 图标定位，不依赖tooltip属性） ===== */
button.ui.small.jump.dropdown.icon.button:has(> svg.octicon-kebab-horizontal) > svg { display: none !important; }
button.ui.small.jump.dropdown.icon.button:has(> svg.octicon-kebab-horizontal) {
  width: auto !important;
  padding: 0 10px !important;
  color: #1f4ba8 !important;
  background: #f4f8ff !important;
  border: 1px solid #dbe3f2 !important;
  border-radius: 8px !important;
}
button.ui.small.jump.dropdown.icon.button:has(> svg.octicon-kebab-horizontal)::before {
  content: "更多操作";
  font-size: 13px;
  font-weight: 500;
  margin-right: 2px;
}
