/* glibCode Git: Gitea 1.26 look (light theme) */
:root {
  --color-primary: #4183c4; --color-primary-dark: #31699f; --color-text: #181c21; --color-text-light: #40474f;
  --color-text-light-2: #5b6167; --color-secondary: #d0d7de; --color-secondary-light: #e1e5e9;
  --color-box-header: #f1f3f5; --color-body: #ffffff; --color-nav-bg: #f6f7fa; --color-footer: #f6f7fa;
  --color-hover: rgba(0, 0, 0, .04); --color-green: #21ba45; --color-red: #db2828; --color-orange: #f2711c;
  --color-diff-added-row-bg: #e6ffed; --color-diff-added-word-bg: #acf2bd; --color-diff-removed-row-bg: #ffeef0;
  --color-code-bg: #fafafa; --color-label-bg: #e8e8e8; --border-radius: 4px;
  --fonts-regular: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --fonts-monospace: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/1.4286 var(--fonts-regular); color: var(--color-text); background: var(--color-body); }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a.muted, .muted-links a { color: inherit; }
a.muted:hover, .muted-links a:hover { color: var(--color-primary); }
code, pre, .mono, .sha { font-family: var(--fonts-monospace); }
.full.height { min-height: calc(100vh - 41px); display: flex; flex-direction: column; }
.ui.container { max-width: 1280px; width: calc(100% - 64px); margin: 0 auto; }
@media (max-width: 767px) { .ui.container { width: calc(100% - 32px); } }

/* navbar */
#navbar { display: flex; justify-content: space-between; align-items: stretch; min-height: 49px; padding: 0 .5rem;
  background: var(--color-nav-bg); border-bottom: 1px solid var(--color-secondary); }
#navbar .navbar-left, #navbar .navbar-right { display: flex; align-items: stretch; }
#navbar .item { display: flex; align-items: center; padding: 0 .9rem; color: var(--color-text); border-radius: 4px; margin: 4px 1px; }
#navbar .item:hover { background: var(--color-hover); text-decoration: none; }
#navbar .item.active { background: var(--color-hover); font-weight: 500; }
#navbar-logo img { width: 30px; height: 30px; }
.tw-ml-1 { margin-left: .25rem; }
svg.svg { vertical-align: middle; fill: currentColor; }

/* home */
.page-content { flex: 1; padding-bottom: 2rem; }
.page-content.home { text-align: center; padding-top: 2rem; }
.home .logo { width: 220px; height: 220px; }
.home .hero h1 { font-size: 3.5em; margin: .3em 0 0; font-weight: 600; }
.home .hero h2 { font-size: 2em; font-weight: 400; margin: .2em 0 1.4em; }
.home .page.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 3rem; max-width: 1000px; margin: 0 auto; padding: 1rem 2rem; text-align: left; }
.home .page.grid h1 { font-size: 1.4em; margin: .6em 0 .3em; }
.home .page.grid p { font-size: 1.15em; color: var(--color-text-light); margin: 0; }
@media (max-width: 767px) { .home .page.grid { grid-template-columns: 1fr; } }

/* buttons, labels, segments */
.ui.button { display: inline-flex; align-items: center; gap: .3rem; padding: .5rem .9rem; border: 1px solid var(--color-secondary);
  border-radius: var(--border-radius); background: var(--color-body); color: var(--color-text); font: inherit; cursor: pointer; }
.ui.button:hover { background: var(--color-hover); text-decoration: none; }
.ui.primary.button { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.ui.primary.button:hover { background: var(--color-primary-dark); }
.ui.compact.button { padding: .3rem .6rem; font-size: 12px; }
.ui.labeled.button { display: inline-flex; padding: 0; border: 0; background: none; }
.ui.labeled.button > .button { border-radius: 4px 0 0 4px; }
.ui.labeled.button > .label { border: 1px solid var(--color-secondary); border-left: 0; border-radius: 0 4px 4px 0; padding: .3rem .6rem; font-size: 12px; color: var(--color-text); background: var(--color-body); }
.ui.label { display: inline-block; padding: .2em .55em; border-radius: 4px; background: var(--color-label-bg); font-size: 12px; color: var(--color-text-light); }
.ui.basic.label { background: var(--color-body); border: 1px solid var(--color-secondary); }
.ui.sha.label { font-family: var(--fonts-monospace); font-size: 12px; background: var(--color-body); border: 1px solid var(--color-secondary); padding: .15em .5em; }
.ui.green.label { color: #fff; background: var(--color-green); }
.ui.segment { border: 1px solid var(--color-secondary); border-radius: var(--border-radius); padding: 1rem; background: var(--color-body); }
.ui.top.attached.header { margin: 0; padding: .7rem 1rem; border: 1px solid var(--color-secondary); border-radius: 4px 4px 0 0; background: var(--color-box-header); font-size: 14px; font-weight: 600; }
.ui.attached.segment { border-top: 0; border-radius: 0 0 4px 4px; }
.ui.message { padding: .8rem 1rem; border-radius: 4px; margin: 1rem 0; border: 1px solid; }
.ui.negative.message { color: #9f3a38; background: #fff6f6; border-color: #e0b4b4; }
.ui.info.message, .ui.warning.message { color: #794b02; background: #fffaf3; border-color: #c9ba9b; }
.ui.positive.message { color: #2c662d; background: #fcfff5; border-color: #a3c293; }

/* repo header */
.secondary-nav { background: var(--color-nav-bg); border-bottom: 1px solid var(--color-secondary); margin-bottom: 1rem; }
.repo-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; padding: 1rem 0 .4rem; }
.repo-header .flex-item-title { font-size: 18px; display: flex; align-items: center; gap: .4rem; }
.repo-header .flex-item-title a { color: var(--color-text); }
.repo-header .flex-item-title .repo-name { font-weight: 600; }
.repo-buttons { display: flex; gap: .4rem; flex-wrap: wrap; }
.ui.tabular.menu { display: flex; gap: .2rem; overflow-x: auto; margin-top: .3rem; }
.ui.tabular.menu .item { padding: .6rem .9rem; color: var(--color-text-light); border-bottom: 2px solid transparent; white-space: nowrap; }
.ui.tabular.menu .item:hover { color: var(--color-text); text-decoration: none; }
.ui.tabular.menu .item.active { color: var(--color-text); border-bottom-color: #f2711c; font-weight: 500; }
.ui.tabular.menu .item .label { margin-left: .3rem; }

/* repo home */
.repo-description { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .6rem; color: var(--color-text-light); font-size: 15px; }
.repo-topic { display: inline-block; padding: .1em .6em; margin: 0 .25rem .25rem 0; border-radius: 2em; background: #e8f1fa; color: var(--color-primary); font-size: 12px; }
.repository-summary { display: flex; border: 1px solid var(--color-secondary); border-radius: 4px 4px 0 0; overflow-x: auto; }
.repository-summary .item { flex: 1; text-align: center; padding: .55rem .8rem; color: var(--color-text); white-space: nowrap; }
.repository-summary .item b { font-weight: 600; }
.language-stats { display: flex; height: 6px; border: 1px solid var(--color-secondary); border-top: 0; border-radius: 0 0 4px 4px; overflow: hidden; margin-bottom: .6rem; }
.language-stats div { height: 100%; }
.language-stats-details { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: 12px; margin-bottom: 1rem; color: var(--color-text-light); }
.color-icon { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.repo-button-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.repo-button-row .left, .repo-button-row .right { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.branch-dropdown-button { font-family: var(--fonts-monospace); }
.repo-path { font-size: 16px; }
.repo-path a, .repo-path span { margin: 0 .15rem; }
.clone-panel { display: inline-flex; align-items: stretch; border: 1px solid var(--color-secondary); border-radius: 4px; overflow: hidden; }
.clone-panel span { padding: .35rem .6rem; background: var(--color-box-header); border-right: 1px solid var(--color-secondary); font-size: 12px; }
.clone-panel input { border: 0; padding: .35rem .6rem; width: 21rem; max-width: 50vw; font: 12px var(--fonts-monospace); color: var(--color-text); background: var(--color-body); }

/* file list */
#repo-files-table { border: 1px solid var(--color-secondary); border-radius: 4px; margin-bottom: 1rem; }
.repo-file-line, .repo-file-item { display: grid; grid-template-columns: minmax(10rem, 2fr) 3fr auto; gap: .8rem; align-items: center;
  padding: .45rem .9rem; border-top: 1px solid var(--color-secondary); }
.repo-file-line.repo-file-last-commit { grid-template-columns: 1fr auto; border-top: 0; background: var(--color-box-header); border-radius: 4px 4px 0 0; }
.repo-file-item:hover { background: var(--color-hover); }
.repo-file-cell.name { display: flex; align-items: center; gap: .5rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.repo-file-cell.message { color: var(--color-text-light); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.repo-file-cell.age { color: var(--color-text-light); white-space: nowrap; font-size: 13px; }
.latest-commit { display: flex; align-items: center; gap: .5rem; overflow: hidden; white-space: nowrap; }
.latest-commit .commit-summary { color: var(--color-text); overflow: hidden; text-overflow: ellipsis; }
.icon-dir { color: #79b8ff; } .icon-file { color: var(--color-text-light-2); }
@media (max-width: 767px) { .repo-file-item { grid-template-columns: 1fr auto; } .repo-file-cell.message { display: none; } }

/* markdown */
.markup { line-height: 1.6; font-size: 15px; overflow-wrap: anywhere; }
.markup h1, .markup h2 { border-bottom: 1px solid var(--color-secondary-light); padding-bottom: .3em; }
.markup h1 { font-size: 1.8em; } .markup h2 { font-size: 1.45em; } .markup h3 { font-size: 1.2em; }
.markup code { background: var(--color-code-bg); border-radius: 4px; padding: .15em .35em; font-size: 85%; }
.markup pre { background: var(--color-code-bg); border: 1px solid var(--color-secondary-light); border-radius: 4px; padding: .8rem 1rem; overflow: auto; }
.markup pre code { background: none; padding: 0; font-size: 13px; }
.markup table { border-collapse: collapse; display: block; overflow: auto; }
.markup th, .markup td { border: 1px solid var(--color-secondary); padding: .35rem .8rem; }
.markup blockquote { margin: 0; padding: 0 1em; color: var(--color-text-light); border-left: .25em solid var(--color-secondary); }
.file-view.markup { padding: 1.5rem 2rem; }

/* code view */
.file-header { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .5rem 1rem;
  border: 1px solid var(--color-secondary); border-radius: 4px 4px 0 0; background: var(--color-box-header); }
.file-info { display: flex; gap: .8rem; color: var(--color-text-light); font-size: 13px; }
.file-actions { display: flex; gap: .3rem; }
.file-view { border: 1px solid var(--color-secondary); border-top: 0; border-radius: 0 0 4px 4px; overflow-x: auto; }
.file-view table { border-collapse: collapse; width: 100%; font: 12px/20px var(--fonts-monospace); }
.lines-num { width: 1%; min-width: 50px; padding: 0 8px 0 16px; text-align: right; color: #999; user-select: none; vertical-align: top; }
.lines-num span::before { content: attr(data-line-number); }
.lines-code { padding: 0 1em; white-space: pre; vertical-align: top; }
.lines-code .c { color: #6a737d; font-style: italic; } .lines-code .s, .code-block .s { color: #032f62; }
.lines-code .n, .code-block .n { color: #005cc5; } .lines-code .k, .code-block .k { color: #d73a49; } .lines-code .f, .code-block .f { color: #6f42c1; }
.code-block .c { color: #6a737d; font-style: italic; }
.blame-info { width: 1%; min-width: 260px; max-width: 360px; padding: 0 .8rem; border-right: 1px solid var(--color-secondary-light);
  vertical-align: top; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-text-light); font-family: var(--fonts-regular); }
.blame-avatar { display: flex; align-items: center; gap: .4rem; }
tr.blame-top td { border-top: 1px solid var(--color-secondary-light); }

/* commits */
#commits-table .commit-row { display: grid; grid-template-columns: minmax(9rem, 14rem) 7rem 1fr auto; gap: .8rem; align-items: center;
  padding: .6rem 1rem; border: 1px solid var(--color-secondary); border-top: 0; }
#commits-table .commit-row:hover { background: var(--color-hover); }
.author { display: flex; align-items: center; gap: .4rem; overflow: hidden; white-space: nowrap; }
.commit-summary-col { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ui.avatar { border-radius: 4px; vertical-align: middle; }
@media (max-width: 767px) { #commits-table .commit-row { grid-template-columns: 1fr auto; } #commits-table .author { display: none; } }

.commit-header { border: 1px solid var(--color-secondary); border-radius: 4px; margin-bottom: 1rem; }
.commit-header .top { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; background: var(--color-box-header); border-bottom: 1px solid var(--color-secondary); }
.commit-header h3 { margin: 0; font-size: 18px; }
.commit-header pre.commit-body { margin: .6rem 0 0; white-space: pre-wrap; font: 13px var(--fonts-regular); color: var(--color-text-light); }
.commit-header .bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .7rem 1rem; }
.diff-detail-stats { margin: .8rem 0; color: var(--color-text-light); }
.diff-file-box { border: 1px solid var(--color-secondary); border-radius: 4px; margin-bottom: 1rem; overflow: hidden; }
.diff-file-header { display: flex; justify-content: space-between; align-items: center; padding: .45rem 1rem; background: var(--color-box-header);
  border-bottom: 1px solid var(--color-secondary); font-family: var(--fonts-monospace); font-size: 12px; }
.diff-stats-bar { display: inline-flex; gap: .3rem; margin-right: .6rem; }
.diff-stats-bar .add { color: var(--color-green); } .diff-stats-bar .del { color: var(--color-red); }
.diff-file-body { overflow-x: auto; }
.diff-file-body table { border-collapse: collapse; width: 100%; font: 12px/20px var(--fonts-monospace); }
.diff-file-body td { padding: 0 .5rem; white-space: pre; }
.diff-file-body td.lines-num { color: #999; text-align: right; width: 1%; min-width: 45px; }
.diff-file-body tr.tag-code td { background: #f1f8ff; color: var(--color-text-light); padding: .2rem .5rem; }
.diff-file-body tr.add-code td { background: var(--color-diff-added-row-bg); }
.diff-file-body tr.del-code td { background: var(--color-diff-removed-row-bg); }

/* lists: explore, branches, releases */
.flex-list > .flex-item { display: flex; gap: .8rem; padding: .9rem 0; border-top: 1px solid var(--color-secondary); }
.flex-list > .flex-item:first-child { border-top: 0; }
.flex-item-main { flex: 1; min-width: 0; }
.flex-item-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.flex-item-body { color: var(--color-text-light); margin-top: .2rem; }
.flex-item-trailing { display: flex; align-items: center; gap: .8rem; color: var(--color-text-light); white-space: nowrap; font-size: 13px; }
.explore-nav { display: flex; gap: .2rem; border-bottom: 1px solid var(--color-secondary); margin-bottom: 1rem; }
.explore-nav a { padding: .6rem 1rem; color: var(--color-text-light); border-bottom: 2px solid transparent; }
.explore-nav a.active { color: var(--color-text); border-bottom-color: #f2711c; }
.search-row { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-row input { flex: 1; padding: .5rem .7rem; border: 1px solid var(--color-secondary); border-radius: 4px; font: inherit; }
.pagination { display: flex; justify-content: center; gap: .2rem; margin: 1.5rem 0; }
.pagination a, .pagination span { padding: .35rem .7rem; border: 1px solid var(--color-secondary); border-radius: 4px; color: var(--color-text); }
.pagination .active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination .disabled { color: #bbb; }
.empty-placeholder { text-align: center; padding: 3rem 1rem; color: var(--color-text-light); }
.empty-placeholder h2 { color: var(--color-text); font-size: 18px; }

/* profile */
.user.profile { display: grid; grid-template-columns: 290px 1fr; gap: 2rem; margin-top: 1.5rem; }
.user.profile .profile-avatar { width: 100%; max-width: 290px; border-radius: 6px; }
.user.profile .header { font-size: 22px; font-weight: 600; margin: .6rem 0 0; }
.user.profile .username { font-size: 18px; color: var(--color-text-light); }
.user.profile ul { list-style: none; padding: 0; color: var(--color-text-light); }
.user.profile ul li { margin: .4rem 0; }
.org-header { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0 1rem; }
.org-header h1 { margin: 0; font-size: 24px; }
.org-layout { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; }
@media (max-width: 767px) { .user.profile, .org-layout { grid-template-columns: 1fr; } }

/* sign in */
.page-content.user.signin { display: flex; justify-content: center; padding-top: 3rem; }
.page-content.user.signin .container { width: 450px; max-width: calc(100% - 32px); }
.ui.form .field { margin-bottom: 1rem; }
.ui.form label { display: block; font-weight: 600; margin-bottom: .3rem; }
.ui.form input[type=text], .ui.form input[type=password], .ui.form input[type=email] { width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--color-secondary); border-radius: 4px; font: inherit; }
.tw-flex { display: flex; } .tw-flex-1 { flex: 1; } .tw-w-full { width: 100%; justify-content: center; }
.tw-text-center { text-align: center; } .tw-my-4 { margin: 1rem 0; } .tw-mb-1 { margin-bottom: .25rem; }

/* 404 */
.status-page-error { text-align: center; padding: 4rem 1rem; }
.status-page-error-title { font-size: 48px; font-weight: 600; color: var(--color-text-light); }

/* footer */
.page-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  padding: .7rem 1rem; background: var(--color-footer); border-top: 1px solid var(--color-secondary); font-size: 13px; color: var(--color-text-light); }
.page-footer .left-links, .page-footer .right-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.page-footer .site-ref { margin: 0; width: 100%; text-align: right; font-size: 12px; }
