/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 20px;
    border-radius: 8px;
}

.welcome-title {
    font-size: 2.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px 0;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-link {
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    background-color: #667eea;
    color: white;
}

/* 消息提示 */
.messages {
    margin-bottom: 20px;
}

.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 首页三列布局 */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.column {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    color: #667eea;
}

/* 高校展示 - 轮播图 */
.showcase-carousel-container {
    position: relative;
    width: 100%;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 400px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    display: flex;
    flex-direction: column;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.carousel-caption {
    flex: 1;
    padding: 15px;
    background-color: white;
    border-radius: 0 0 8px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-university-name {
    font-size: 1.3em;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: bold;
}

.carousel-description {
    font-size: 0.95em;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* 轮播控制按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(102, 126, 234, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background-color: rgba(102, 126, 234, 1);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: rgba(102, 126, 234, 1);
}

.indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.showcase-placeholder {
    width: 100%;
    height: 400px;
    background-color: #e9ecef;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #6c757d;
}

.placeholder-text {
    font-size: 0.9em;
    margin-top: 10px;
}

/* 新闻样式 */
.news-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-item {
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.news-item:last-child {
    border-bottom: none;
}

.news-title {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.news-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.news-title a:hover {
    color: #667eea;
}

.news-meta {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.news-excerpt {
    color: #666;
    line-height: 1.8;
}

.more-link {
    margin-top: 20px;
    text-align: center;
}

.more-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.more-link a:hover {
    text-decoration: underline;
}

/* 右侧栏 */
.auth-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.user-info {
    text-align: center;
}

.user-info p {
    margin-bottom: 10px;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.university-list-section {
    margin-top: 20px;
}

.list-title {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #667eea;
}

.university-list {
    list-style: none;
}

.university-item {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.university-item:last-child {
    border-bottom: none;
}

.university-item a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

.university-item a:hover {
    color: #667eea;
    padding-left: 5px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-block {
    width: 100%;
}

/* 认证页面 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.auth-box {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

.auth-title {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
    font-size: 2em;
}

.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.required {
    color: red;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    margin-top: 30px;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links p {
    margin-bottom: 10px;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* 个人中心 */
.profile-container {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.profile-box {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
}

.profile-title {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
    font-size: 2em;
}

.profile-info {
    margin-bottom: 30px;
}

.info-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    width: 150px;
    color: #666;
}

.info-value {
    flex: 1;
    color: #333;
}

.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 学校主页 */
.school-home-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.school-header {
    margin-bottom: 30px;
    text-align: center;
}

.school-name {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 20px;
}

.school-showcase {
    margin-top: 20px;
}

.school-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.school-description {
    font-size: 1.1em;
    line-height: 1.8;
    color: #666;
}

.school-content {
    margin-top: 30px;
}

.school-news-list {
    margin-top: 20px;
}

/* 新闻列表和详情 */
.news-list-container,
.news-detail-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-title {
    font-size: 2em;
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.news-detail {
    max-width: 900px;
    margin: 0 auto;
}

.news-detail .news-title {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}

.news-detail .news-meta {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.news-image {
    margin: 30px 0;
    text-align: center;
}

.news-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.news-content {
    font-size: 1.1em;
    line-height: 2;
    color: #333;
    margin-bottom: 30px;
}

.news-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 高校联盟 */
.alliance-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.university-card {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.university-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.university-card .university-name {
    font-size: 1.5em;
    color: #667eea;
    margin-bottom: 15px;
}

.university-card .university-desc {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* 堆塔 */
.duita-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.duita-content {
    padding: 40px;
    color: #666;
}

/* 我的院校 */
.my-school-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-content {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    margin-top: 40px;
}

/* 响应式设计 */
@media (max-width: 968px) {
    .home-layout {
        grid-template-columns: 1fr;
    }
    
    .welcome-title {
        font-size: 2em;
    }
    
    .navbar {
        flex-wrap: wrap;
    }
    
    .university-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-slides {
        height: 350px;
    }
    
    .carousel-image {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .welcome-title {
        font-size: 1.5em;
    }
    
    .nav-link {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .auth-box,
    .profile-box {
        padding: 20px;
    }
    
    .carousel-slides {
        height: 300px;
    }
    
    .carousel-image {
        height: 180px;
    }
    
    .carousel-caption {
        padding: 10px;
    }
    
    .carousel-university-name {
        font-size: 1.1em;
    }
    
    .carousel-description {
        font-size: 0.85em;
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .carousel-prev {
        left: 5px;
    }
    
    .carousel-next {
        right: 5px;
    }
}

/* 二手交易相关样式 */
.content-tabs {
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 二手交易列表 */
.secondhand-list-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.page-title {
    font-size: 2em;
    color: #667eea;
    margin: 0;
}

.page-subtitle {
    color: #666;
    margin-top: 5px;
}

.filter-bar {
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 10px;
}

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

.secondhand-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e9ecef;
}

.secondhand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #e9ecef;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    color: #999;
}

.card-body {
    padding: 15px;
}

.card-title {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.card-title a:hover {
    color: #667eea;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-price {
    font-size: 1.3em;
    font-weight: bold;
    color: #e74c3c;
}

.card-category {
    background-color: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
}

.card-desc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
    line-height: 1.6;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #999;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* 二手交易详情 */
.secondhand-detail-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-header {
    margin-bottom: 30px;
}

.back-link {
    color: #667eea;
    text-decoration: none;
    margin-bottom: 10px;
    display: inline-block;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-title {
    font-size: 2em;
    color: #333;
    margin-top: 10px;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.detail-image {
    width: 100%;
}

.detail-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.no-image-large {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    color: #999;
    border-radius: 8px;
}

.detail-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.detail-info .info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-info .info-row:last-child {
    border-bottom: none;
}

.detail-info .info-label {
    font-weight: 500;
    width: 120px;
    color: #666;
}

.detail-info .info-value {
    flex: 1;
    color: #333;
}

.detail-info .price {
    font-size: 1.5em;
    font-weight: bold;
    color: #e74c3c;
}

.contact-phone {
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
}

.text-muted {
    color: #6c757d;
}

/* 权限警告 */
.permission-warning {
    margin-bottom: 30px;
}

.warning-box {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.warning-box h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.warning-box p {
    color: #856404;
    margin: 10px 0;
    line-height: 1.8;
}

.card-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.card-note .text-muted {
    font-size: 0.85em;
    color: #6c757d;
}

.detail-description {
    margin-bottom: 30px;
}

.desc-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #667eea;
}

.desc-content {
    line-height: 2;
    color: #333;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.detail-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 发布二手信息 */
.create-container {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.create-box {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 700px;
}

.create-title {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
    font-size: 2em;
}

.create-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #666;
}

/* 密码强度提示 */
.password-strength {
    margin-top: 5px;
    font-size: 0.85em;
}

.strength-weak {
    color: #dc3545;
}

.strength-medium {
    color: #ffc107;
}

.strength-strong {
    color: #28a745;
}

/* 手机号验证提示 */
.phone-validate {
    margin-top: 5px;
    font-size: 0.85em;
}

.validate-error {
    color: #dc3545;
}

.validate-success {
    color: #28a745;
}

.form-note {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border-radius: 5px;
}

.note-text {
    margin: 0;
    color: #856404;
    font-size: 0.9em;
}

/* 我的二手交易 */
.my-secondhand-container {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.items-table th,
.items-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.items-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.items-table tr:hover {
    background-color: #f8f9fa;
}

.table-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-pending {
    background-color: #ffc107;
    color: #856404;
}

.status-approved {
    background-color: #28a745;
    color: white;
}

.status-rejected {
    background-color: #dc3545;
    color: white;
}

.status-sold {
    background-color: #6c757d;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9em;
}

.empty-actions {
    text-align: center;
    margin-top: 30px;
}

/* 学校主页二手交易列表 */
.secondhand-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.secondhand-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: box-shadow 0.3s;
}

.secondhand-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.secondhand-item .item-image {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    background-color: #e9ecef;
}

.secondhand-item .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.secondhand-item .item-info {
    flex: 1;
}

.secondhand-item .item-title {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.secondhand-item .item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.secondhand-item .item-title a:hover {
    color: #667eea;
}

.secondhand-item .item-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.secondhand-item .item-price {
    font-size: 1.3em;
    font-weight: bold;
    color: #e74c3c;
}

.secondhand-item .item-desc {
    color: #666;
    line-height: 1.6;
}

/* 响应式：二手交易 */
@media (max-width: 768px) {
    .detail-content {
        grid-template-columns: 1fr;
    }
    
    .secondhand-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .secondhand-item {
        flex-direction: column;
    }
    
    .secondhand-item .item-image {
        width: 100%;
        height: 200px;
    }
    
    .items-table {
        font-size: 0.9em;
    }
    
    .items-table th,
    .items-table td {
        padding: 8px;
    }
}

