/* Basic Reset & Body Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
    line-height: 0.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Header Styles */
header {
    background-color: #fff;
    color: #333;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #5cb85c;
}

footer p{
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    margin-right: 10px;
    /* filter: drop-shadow(2px 2px 2px #aaa); Example of a subtle effect */
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #5cb85c;
    font-weight: bold; /* Font property */
}

.search-bar {
    display: flex;
    flex-grow: 0.5; /* Allows search bar to take available space */
    max-width: 400px; /* Max width for search bar */
}

.search-bar input[type="search"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    flex-grow: 1;
    font-size: 0.9rem; /* Font property */
}

.search-bar button {
    padding: 0.5rem 1rem;
    background-color: #5cb85c;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    transition: background-color 0.3s ease; /* Transition for button */
}

.search-bar button:hover {
    background-color: #4cae4c;
}

.auth-links a, .auth-links-simple a {
    color: #5cb85c;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 600; /* Font property */
}

.auth-links a:hover, .auth-links-simple a:hover {
    text-decoration: underline;
}

/* Main Navigation Styles */
.main-nav {
    background-color: #333;
    padding: 0.5rem 0; /* Vertical padding */
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: space-evenly; 
}

.main-nav ul li {
    position: relative; /* For submenu positioning */
}

.main-nav ul li a {
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem; /* Increased padding for richer feel */
    display: block;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
    font-size: 1rem; /* Font property */
    text-transform: uppercase; /* Text transformation */
    letter-spacing: 0.5px; /* Text property */
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    background-color: #5cb85c;
    color: #fff;
}

/* Submenu Styles (Secondary Navigation) */
.main-nav ul .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #444; /* Slightly different background for submenu */
    min-width: 200px; /* Richer width */
    z-index: 1000;
    padding: 0; /* Remove padding from ul */
    border-top: 3px solid #5cb85c; /* Accent border */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Box shadow for depth */
}

.main-nav ul li:hover > .submenu { /* Display on hover of parent li */
    display: block;
}

.main-nav ul .submenu li {
    width: 100%; /* Full width list items */
}

.main-nav ul .submenu li a {
    padding: 0.8rem 1.2rem; /* Padding for submenu items */
    color: #eee; /* Lighter text color for submenu */
    font-size: 0.9rem; /* Font property */
    text-transform: none; /* Normal text case */
    border-bottom: 1px solid #555; /* Separator */
}

.main-nav ul .submenu li:last-child a {
    border-bottom: none; /* No border for the last item */
}

.main-nav ul .submenu li a:hover {
    background-color: #5cb85c;
    color: #fff;
}

/* 1. 主要内容区域布局 (与其他子页面保持一致) */
.subpage-main {
    max-width: 960px;
    margin: 2rem auto;
    padding: 2.5rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.subpage-main h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #343a40;
}

.subpage-main > p {
    text-align: center;
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 2.5rem;
}

/* 2. 筛选控件 (.filter-controls) 样式 */
.filter-controls {
    display: flex;
    gap: 1.5rem; /* 筛选框之间的间距 */
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.filter-controls select {
    flex: 1; /* 让两个筛选框平分宽度 */
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: all 0.2s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* 自定义下拉箭头 */
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23343a40" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.filter-controls select:focus {
    outline: none;
    border-color: #5cb85c;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.2);
}

/* 3. 动作列表项 (.exercise-item) 样式 */
.exercise-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* 列表项之间的垂直间距 */
}

.exercise-item {
    display: flex;
    align-items: center; /* 垂直居中对齐图片和文字信息 */
    gap: 1.5rem; /* 图片和文字之间的间距 */
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.exercise-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

/* 动作缩略图 */
.exercise-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover; /* 保证图片不变形地填充容器 */
    border-radius: 6px;
    flex-shrink: 0; /* 防止图片在flex布局中被压缩 */
}

/* 动作文字信息 */
.exercise-info {
    flex-grow: 1; /* 占据剩余的所有空间 */
}

.exercise-info h3 {
    color: #5cb85c;
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.exercise-info p {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.exercise-info p strong {
    color: #343a40;
    margin-right: 0.5rem;
}

/* “查看详情”按钮 */
.exercise-info .btn {
    display: inline-block; /* 转换为行内块元素以应用padding和margin */
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}
