/* ============================================================================
   Fossil-Manager 样式表
   简洁现代的管理面板风格
   ============================================================================ */

/* --- 基础重置与变量 --- */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* --- 导航栏 --- */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-login {
    color: #707070 !important;
    font-weight: 400;
    font-size: 13px;
    text-decoration: none;
}

.nav-login:hover {
    color: #333 !important;
    text-decoration: underline;
}

.nav-user {
    color: var(--text);
    font-weight: 600;
    font-size: 0.875rem;
}

/* --- 主容器 --- */
.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* --- 页面头部 --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
}

/* --- 按钮 --- */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--danger);
}

/* --- 表格 --- */
.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.table th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* --- 表单 --- */
.auth-container,
.form-container {
    max-width: 480px;
    margin: 3rem auto;
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-container h1,
.form-container h1 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* --- 提示框 --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

/* --- 空状态 --- */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* --- Public Repositories Page (Bitbucket Style) --- */
.repo-page {
    max-width: 980px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.repo-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0 16px;
}

.repo-page-header h2 {
    font-size: 20px;
    font-weight: 400;
    margin: 0;
    color: #333;
}

.repo-filter {
    position: relative;
}

.repo-filter svg {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.repo-filter input {
    padding: 6px 10px 6px 28px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    width: 210px;
    color: #333;
    background: #fff;
}

.repo-filter input:focus {
    outline: none;
    border-color: #7ab8f5;
    box-shadow: 0 0 0 1px #7ab8f5;
}

/* content = nav + table side by side */
.repo-content {
    display: flex;
    align-items: stretch;
    border-top: 1px solid #ccc;
    min-height: 300px;
}

/* left nav */
.repo-nav {
    flex: 0 0 120px;
    border-right: 1px solid #ddd;
    padding-top: 14px;
}

.repo-nav-item {
    display: block;
    padding: 4px 14px 4px 12px;
    font-size: 12px;
    color: #3572b0;
    text-decoration: none;
    border-left: 3px solid transparent;
    line-height: 1.8;
    white-space: nowrap;
}

.repo-nav-item:hover {
    text-decoration: underline;
}

.repo-nav-item.active {
    font-weight: 600;
    color: #333;
    border-left-color: #3572b0;
    text-decoration: none;
}

/* right table area */
.repo-list-wrapper {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.repo-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.repo-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #707070;
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
}

.repo-table thead th.name-col {
    width: 48%;
    padding-left: 20px;
}

.repo-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 13px;
    color: #707070;
}

.repo-table tbody td.name-col {
    padding-left: 20px;
}

.repo-table tbody tr:last-child td {
    border-bottom: none;
}

.repo-table tbody tr:hover td {
    background: #f5f7fa;
}

.repo-table td.name-col .name-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.repo-table td.name-col a {
    color: #3572b0;
    text-decoration: none;
    font-size: 13px;
}

.repo-table td.name-col a:hover {
    text-decoration: underline;
    color: #3572b0;
}

.repo-table td.desc-col {
    color: #707070;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-table .empty-msg {
    padding: 60px 12px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* green repo icon */
.repo-icon-box {
    display: inline-block;
    width: 15px;
    height: 15px;
    background: #c8e6c9;
    border: 1px solid #66bb6a;
    border-radius: 2px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* 仪表盘仓库名链接 */
.table td a {
    color: var(--primary);
    text-decoration: none;
}

.table td a:hover {
    text-decoration: underline;
}

/* --- 设置页面 --- */
.settings-page {
    max-width: 520px;
    margin: 0 auto;
}

.settings-page h2 {
    font-size: 20px;
    font-weight: 400;
    color: #333;
    margin: 0 0 20px;
}

.settings-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 14px;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* --- 页脚 --- */
.footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

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

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

.footer-sep {
    margin: 0 8px;
    color: #ccc;
}

.police-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 3px;
}
