/* style.css - 黑白主题友情链接系统样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #f0f0f0;
    background-color: #0a0a0a;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 排版 */
h1, h2, h3, h4, h5, h6 {
    color: #fff;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

h2 {
    font-size: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
    margin-bottom: 25px;
}

h3 {
    font-size: 1.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 6px;
    margin-bottom: 20px;
}

p {
    margin-bottom: 15px;
    color: #ddd;
}

a {
    color: #8bc34a;
    text-decoration: none;
    transition: color 0.3s;
}

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

ul, ol {
    margin-left: 20px;
    margin-bottom: 20px;
    color: #ddd;
}

li {
    margin-bottom: 8px;
}

/* 导航栏 */
.nav-links {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #ddd;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    background-color: #222;
    transition: all 0.3s;
    border: 1px solid #333;
    font-weight: 500;
}

.nav-links a:hover {
    background-color: #333;
    text-decoration: none;
    border-color: #666;
}

/* 容器布局 */
.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    flex: 1;
}

/* 区域样式 */
.form-section, 
.info-section, 
.links-container, 
.link-detail, 
.applications-container, 
.site-info,
.application-item,
.link-item {
    background-color: #1a1a1a;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-section:hover,
.info-section:hover,
.link-card:hover,
.application-item:hover,
.link-item:hover {
    border-color: #666;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
    font-weight: 500;
    font-size: 0.95rem;
}

.required:after {
    content: " *";
    color: #ff4444;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    color: #f0f0f0;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #8bc34a;
    box-shadow: 0 0 0 2px rgba(139, 195, 74, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* 按钮样式 */
button, 
.btn {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: 1px solid #444;
}

button:hover, 
.btn:hover {
    background-color: #444;
    border-color: #666;
    text-decoration: none;
}

.btn-primary {
    background-color: #444;
    border-color: #555;
}

.btn-primary:hover {
    background-color: #555;
    border-color: #777;
}

.btn-approve {
    background-color: #1a3c1a;
    border-color: #2d5a2d;
}

.btn-approve:hover {
    background-color: #2d5a2d;
    border-color: #3d7a3d;
}

.btn-reject {
    background-color: #3c1a1a;
    border-color: #5a2d2d;
}

.btn-reject:hover {
    background-color: #5a2d2d;
    border-color: #7a3d3d;
}

.btn-delete {
    background-color: #3c1a1a;
    border-color: #5a2d2d;
}

.btn-delete:hover {
    background-color: #5a2d2d;
    border-color: #7a3d3d;
}

.btn-edit {
    background-color: #1a1a3c;
    border-color: #2d2d5a;
}

.btn-edit:hover {
    background-color: #2d2d5a;
    border-color: #3d3d7a;
}

/* 消息提示 */
.message {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 25px;
    border: 1px solid;
    font-weight: 500;
}

.success {
    background-color: #1a3c1a;
    border-color: #2d5a2d;
    color: #8bc34a;
}

.error {
    background-color: #3c1a1a;
    border-color: #5a2d2d;
    color: #ff6b6b;
}

.info {
    background-color: #1a1a3c;
    border-color: #2d2d5a;
    color: #6b8cff;
}

.warning {
    background-color: #3c3c1a;
    border-color: #5a5a2d;
    color: #ffcc00;
}

/* 警告框 */
.warning-box {
    background-color: #2a2a1a;
    border: 1px solid #555522;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.warning-title {
    color: #ffcc00;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-title:before {
    content: "⚠";
    font-size: 1.2rem;
}

.warning-box ul {
    margin-left: 25px;
}

.warning-box li {
    margin-bottom: 8px;
    color: #ddd;
}

/* 友情链接卡片 */
.links-container-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.link-card {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #333;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.link-card:hover {
    transform: translateY(-5px);
    border-color: #666;
    text-decoration: none;
    color: inherit;
}

.link-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.link-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 15px;
    object-fit: cover;
    background-color: #222;
    padding: 5px;
}

.link-title {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 600;
    flex: 1;
}

.link-description {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 状态标签 */
.link-status, 
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online {
    background-color: #1a3c1a;
    color: #8bc34a;
    border: 1px solid #2d5a2d;
}

.status-offline {
    background-color: #3c1a1a;
    color: #ff6b6b;
    border: 1px solid #5a2d2d;
}

.status-pending {
    background-color: #3c3c1a;
    color: #ffcc00;
    border: 1px solid #5a5a2d;
}

.status-approved {
    background-color: #1a3c1a;
    color: #8bc34a;
    border: 1px solid #2d5a2d;
}

.status-rejected {
    background-color: #3c1a1a;
    color: #ff6b6b;
    border: 1px solid #5a2d2d;
}

.status-deleted {
    background-color: #2a2a2a;
    color: #aaa;
    border: 1px solid #444;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    grid-column: 1 / -1;
}

.empty-state h3 {
    border-bottom: none;
    margin-bottom: 10px;
    color: #aaa;
}

.empty-state p {
    color: #888;
    max-width: 500px;
    margin: 0 auto;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal h2, .modal h3 {
    border-bottom: none;
    margin-top: 0;
}

/* 通知模态框 */
.notice-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.notice-content {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.notice-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.notice-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.notice-approved {
    border-left: 4px solid #2d5a2d;
    padding-left: 15px;
}

.notice-rejected {
    border-left: 4px solid #5a2d2d;
    padding-left: 15px;
}

/* 应用项和链接项 */
.application-item, 
.link-item {
    margin-bottom: 20px;
}

.application-header, 
.link-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.application-title, 
.link-title {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 600;
}

.application-info, 
.link-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    margin-bottom: 10px;
}

.info-label {
    color: #bbb;
    font-size: 0.85rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.info-value {
    color: #fff;
    font-size: 1rem;
    word-break: break-all;
}

.info-value a {
    color: #8bc34a;
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

.empty-field {
    color: #888;
    font-style: italic;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* 表单操作 */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 网站信息区域 */
.site-info {
    margin-top: 30px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

/* 详情页面 */
.link-detail {
    margin-top: 20px;
}

.link-header-large {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.link-icon-large {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 20px;
    object-fit: cover;
    background-color: #222;
    padding: 8px;
}

.link-title-large {
    font-size: 1.8rem;
    color: #fff;
    font-weight: 600;
}

.link-url {
    color: #8bc34a;
    text-decoration: none;
    font-size: 1rem;
    margin-top: 5px;
    display: inline-block;
    word-break: break-all;
}

.link-url:hover {
    text-decoration: underline;
    color: #a5d76a;
}

.detail-item {
    margin-bottom: 20px;
}

.detail-label {
    color: #bbb;
    font-size: 0.9rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.detail-value {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* 页脚 */
.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.footer p {
    margin-bottom: 10px;
    color: #aaa;
}

/* 实用类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-40 {
    margin-top: 40px;
}

.mb-40 {
    margin-bottom: 40px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .links-container-grid {
        grid-template-columns: 1fr;
    }
    
    .application-info,
    .link-info,
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .nav-links {
        justify-content: center;
    }
    
    .action-buttons,
    .form-actions {
        justify-content: center;
    }
    
    .link-header-large {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .link-icon-large {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .form-section, 
    .info-section, 
    .links-container, 
    .link-detail, 
    .applications-container, 
    .site-info,
    .application-item,
    .link-item {
        padding: 20px 15px;
    }
    
    .nav-links a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    button, .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #8bc34a;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #222;
    color: #fff;
    text-align: center;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #444;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    font-weight: normal;
    line-height: 1.4;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
